Spaces:
Sleeping
Sleeping
Download Dockerfile from misack/war_gaming: direct link, hf CLI and curl.
- Browser
- Download file 914 Bytes
-
https://huggingface.co/spaces/misack/war_gaming/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/misack/war_gaming/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/misack/war_gaming/resolve/main/Dockerfile
914 Bytes
| # Wargame backend image — sized for Hugging Face Spaces (Docker SDK). | |
| # | |
| # HF Spaces conventions baked in: | |
| # - container listens on port 7860 | |
| # - persistent storage mounts at /data, so WARGAME_GAMES_DIR points there | |
| # | |
| # Local sanity check: | |
| # docker build -t wargame . | |
| # docker run --rm -p 7860:7860 --env-file .env -v $(pwd)/games:/data wargame | |
| FROM python:3.12-slim | |
| # uv: fast resolver/installer; reads pyproject.toml + uv.lock directly | |
| RUN pip install --no-cache-dir uv | |
| WORKDIR /app | |
| # Copy lockfile + project metadata first so dependency installs are cached | |
| # across code-only edits. | |
| COPY pyproject.toml uv.lock ./ | |
| COPY wargame/ ./wargame/ | |
| # Install main deps only (no [dev] extras). --frozen forces uv.lock to match. | |
| RUN uv sync --frozen | |
| ENV WARGAME_GAMES_DIR=/data \ | |
| PYTHONUNBUFFERED=1 | |
| EXPOSE 7860 | |
| CMD ["uv", "run", "uvicorn", "wargame.api.app:app", "--host", "0.0.0.0", "--port", "7860"] | |