File size: 896 Bytes
281711d f8ebdd2 fb695b7 1bcb06b fb695b7 281711d 1bcb06b 281711d 1bcb06b 281711d d2b4a3a 1bcb06b d2b4a3a 1bcb06b |
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 27 28 29 30 31 32 33 34 |
FROM python:3.10-slim
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
libnetcdf-dev \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
# Note(Lood): Mount with -v "$PWD:/home/user/app" to overwrite the COPY below
RUN pip install --no-cache-dir --upgrade pip
# Enable quick rebuilds by only copying requirements in this layer
COPY --chown=user requirements.txt $HOME/app
RUN pip install -r requirements.txt
COPY --chown=user . $HOME/app
EXPOSE 7860
ENV GRADIO_SERVER_NAME="0.0.0.0"
CMD ["python", "app.py"]
# Running with gradio enables hot reloading (https://www.gradio.app/guides/developing-faster-with-reload-mode)
# CMD ["gradio", "app.py"]
# Or just run the container without the entrypoint and rerun the python app.py command when you want to reload
|