Spaces:
Running
Running
File size: 851 Bytes
ff82a39 202a057 ff82a39 cb5a3c8 202a057 ff82a39 cb5a3c8 34e8218 ff82a39 cb5a3c8 202a057 ff82a39 202a057 e1ef234 4740c61 ff82a39 202a057 cb5a3c8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
FROM condaforge/mambaforge:latest
# The HF Space container runs with user ID 1000.
# Use jovyan as the username to match Jupyter convention
RUN useradd -m -u 1000 jovyan
USER jovyan
# Set home to the user's home directory
ENV HOME=/home/jovyan \
PATH=/home/jovyan/.local/bin:$PATH
# Set the working directory to the user's home directory
WORKDIR $HOME/app
COPY --chown=jovyan . .
RUN mamba env create --prefix $HOME/env -f ./environment.yml
# Create notebooks directory and copy notebooks there for Hugging Face deployment
# (local volume mounts will override this)
RUN mkdir -p /home/jovyan/notebooks && \
cp -r /home/jovyan/app/notebooks/* /home/jovyan/notebooks/ 2>/dev/null || true
EXPOSE 7860
WORKDIR $HOME/app
CMD ["mamba", "run", "-p", "/home/jovyan/env", "--no-capture-output", "voila", "--no-browser", "/home/jovyan/notebooks/"] |