Spaces:
Sleeping
Sleeping
FROM continuumio/miniconda3:latest | |
# Copy the environment YAML file into the container | |
COPY environment.yml /app/environment.yml | |
# Install dependencies from the YAML file | |
RUN conda env create -f /app/environment.yml && conda clean -afy | |
# Activate the environment by default | |
SHELL ["/bin/bash", "-c"] | |
RUN echo "conda activate cloudspace" >> ~/.bashrc | |
# Set the default shell to use the environment | |
ENV PATH /opt/conda/envs/cloudspace/bin:$PATH | |
# Set up a new user named "user" with user ID 1000 | |
RUN useradd -m -u 1000 user | |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user | |
COPY --chown=user . /home/user/app | |
# Make the run.sh script executable | |
RUN chmod +x /home/user/app/run.sh | |
# Switch to the "user" user | |
USER user | |
# Set home to the user's home directory | |
ENV HOME=/home/user \ | |
PYTHONPATH=$HOME/app \ | |
PYTHONUNBUFFERED=1 \ | |
GRADIO_ALLOW_FLAGGING=never \ | |
GRADIO_NUM_PORTS=1 \ | |
GRADIO_SERVER_NAME=0.0.0.0 \ | |
GRADIO_THEME=huggingface \ | |
SYSTEM=spaces | |
# Set the working directory to the user's home directory | |
WORKDIR $HOME/app | |
CMD ["./run.sh"] | |