Files
physicalCombinatorics/Dockerfile
asimonson1125 8171fc023e public-release phases 1-3: read-only public mode, gunicorn container, demo bootstrap, CI, README
- before_request guard: visitors browse + explore; writes need PHYSCOM_ADMIN_TOKEN login
- SameSite=Lax/HttpOnly cookies, persisted secret key, debug off unless FLASK_DEBUG=1
- non-root gunicorn container with healthcheck; physcom demo --if-empty on first start
- landing page Top Concepts, write controls hidden from visitors
- CI workflow, pyproject metadata, compose Ollama parity, README rewrite
- tests/test_web_access.py: access control + GET smoke test of every page

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-25 15:40:02 -05:00

24 lines
833 B
Docker

FROM python:3.13-slim AS base
WORKDIR /app
COPY pyproject.toml README.md ./
COPY src/ src/
RUN pip install --no-cache-dir ".[web,gemini]" \
&& useradd --create-home --uid 1000 physcom \
&& mkdir -p /app/data && chown physcom:physcom /app/data
USER physcom
VOLUME /app/data
ENV PHYSCOM_DB=/app/data/physcom.db
EXPOSE 5000
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s \
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:5000/', timeout=4)"
# First start on an empty volume builds the demo data (~20s: seed + passes
# 1-3 for every domain). One gunicorn worker: pipeline runs are background
# threads inside the web process.
CMD ["sh", "-c", "physcom demo --if-empty && exec gunicorn --workers 1 --threads 8 --timeout 120 --bind 0.0.0.0:5000 'physcom_web.app:create_app()'"]