exorcist-game/docker/Dockerfile
Jarian 7ec5ae1664 fix: batch fix all 14 issues
- Fix memory test infinite loop (#1, #3) — add max iterations counter
- Fix os.system command injection (#2, #4) — use subprocess with list args
- Fix demon difficulty scaling (#5) — scale health/damage per cycle
- Fix relative import (#6) — absolute imports with sys.path fallback
- Fix normalize_text non-ASCII (#7) — use isalpha/isdigit instead of isalnum
- Fix calculate_similarity word order (#8) — set-based intersection
- Add CMD to Dockerfile (#9)
- Remove test files from prod image (#10) — .dockerignore + strip tests COPY
- Fix test class import (#11) — lazy import in test methods
- Fix pyproject.toml duplicate pytest (#12) — move to dev optional deps
- Add resource limits to compose (#13)
- Fix verses.json quality (#14) — fix garbled verse text
2026-07-05 22:22:41 +00:00

29 lines
473 B
Docker

FROM python:3.12-slim AS builder
WORKDIR /build
RUN pip install --no-cache-dir uv==0.7.12
COPY pyproject.toml ./
COPY uv.lock ./
COPY verses.json ./
RUN uv sync --frozen
FROM python:3.12-slim
RUN useradd --create-home app
WORKDIR /app
COPY --chown=app:app --from=builder /build/.venv /app/.venv
COPY --chown=app:app main.py ./
COPY --chown=app:app data.py ./
COPY --chown=app:app verses.json ./
USER app
ENV PATH="/app/.venv/bin:$PATH"
CMD ["python", "main.py"]