Spaces:
Sleeping
Sleeping
Download Dockerfile from gvatsal60/github-test: direct link, hf CLI and curl.
- Browser
- Download file 2.33 kB
-
https://huggingface.co/spaces/gvatsal60/github-test/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/gvatsal60/github-test/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/gvatsal60/github-test/resolve/main/Dockerfile
2.33 kB
| # ########################################################################## | |
| # File: Dockerfile | |
| # Author: Vatsal Gupta (gvatsal60) | |
| # Description: Dockerfile for a Streamlit application. | |
| # ########################################################################## | |
| # ########################################################################## | |
| # License | |
| # ########################################################################## | |
| # This Dockerfile is licensed under the Apache 2.0 License. | |
| # License information should be updated as necessary. | |
| # ########################################################################## | |
| # ########################################################################## | |
| # Base Image | |
| # ########################################################################## | |
| FROM ghcr.io/astral-sh/uv:python3.12-trixie-slim | |
| # ########################################################################## | |
| # Maintainer | |
| # ########################################################################## | |
| LABEL maintainer="Vatsal Gupta (gvatsal60)" | |
| # Add non-root user | |
| RUN addgroup --system nonroot \ | |
| && adduser --system --ingroup nonroot nonroot | |
| # ########################################################################## | |
| # Set Working Directory | |
| # ########################################################################## | |
| WORKDIR /app | |
| # Set cache directory to /tmp to avoid permission issues | |
| ENV XDG_CACHE_HOME=/tmp/.cache | |
| # ########################################################################## | |
| # Copy Files | |
| # ########################################################################## | |
| # Copy dependency files first for better caching | |
| COPY pyproject.toml ./ | |
| # Install dependencies into a local folder | |
| RUN uv sync --no-cache --quiet | |
| # Copy source code | |
| COPY src/ ./ | |
| # ########################################################################## | |
| # Expose Port | |
| # ########################################################################## | |
| EXPOSE 8501 | |
| # ########################################################################## | |
| # Command to Run | |
| # ########################################################################## | |
| # Switch to non-root user | |
| USER nonroot | |
| ENTRYPOINT [ "uv", "run", \ | |
| "streamlit", "run", "app.py", \ | |
| "--server.port=8501", \ | |
| "--server.address=0.0.0.0", \ | |
| "--browser.gatherUsageStats=false"] | |