Spaces:
Running
Running
| FROM astral/uv:python3.12-bookworm | |
| # Create a working directory | |
| WORKDIR /app | |
| ENV HOME=/home/user | |
| WORKDIR $HOME/app | |
| # User Debian packages | |
| ## Security warning : Potential user code executed as root (build time) | |
| RUN --mount=target=/root/packages.txt,source=packages.txt \ | |
| apt-get update && \ | |
| xargs -r -a /root/packages.txt apt-get install -y --no-install-recommends \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \ | |
| bash /root/on_startup.sh | |
| RUN mkdir /data | |
| # Jupyterlab | |
| RUN uv pip install --system jupyterlab==3.6.1 jupyter-server==2.3.0 tornado==6.2 ipywidgets plotly | |
| RUN uv pip install --system catppuccin-jupyterlab | |
| RUN mkdir -p $HOME/.jupyter/lab/user-settings/@jupyterlab/apputils-extension | |
| RUN mkdir -p $HOME/.jupyter/lab/user-settings/catppuccin_jupyterlab | |
| RUN echo '{"theme": "Catppuccin Frappé"}' > $HOME/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings | |
| RUN echo '{"brandColor": "peach", "accentColor": "green"}' > $HOME/.jupyter/lab/user-settings/catppuccin_jupyterlab/plugin.jupyterlab-settings | |
| # User Python packages | |
| RUN --mount=target=requirements.txt,source=requirements.txt \ | |
| uv pip install --system --no-cache-dir --upgrade -r requirements.txt | |
| # Copy the current directory contents into the container at $HOME/app setting the owner to the user | |
| COPY . $HOME/app | |
| RUN chmod +x start_server.sh | |
| COPY login.html /usr/local/lib/python3.12/site-packages/jupyter_server/templates/login.html | |
| ENV PYTHONUNBUFFERED=1 \ | |
| GRADIO_ALLOW_FLAGGING=never \ | |
| GRADIO_NUM_PORTS=1 \ | |
| GRADIO_SERVER_NAME=0.0.0.0 \ | |
| GRADIO_THEME=huggingface \ | |
| HF_HOME=/data/.cache/huggingface \ | |
| SYSTEM=spaces \ | |
| SHELL=/bin/bash | |
| CMD ["./start_server.sh"] | |