- 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>
39 lines
1.0 KiB
YAML
39 lines
1.0 KiB
YAML
x-env: &env
|
|
PHYSCOM_DB: /app/data/physcom.db
|
|
LLM_PROVIDER: ${LLM_PROVIDER:-}
|
|
GEMINI_API_KEY: ${GEMINI_API_KEY:-}
|
|
GEMINI_MODEL: ${GEMINI_MODEL:-gemini-2.0-flash}
|
|
OLLAMA_MODEL: ${OLLAMA_MODEL:-qwen2.5:7b}
|
|
# Ollama running on the host machine, not in this container.
|
|
OLLAMA_HOST: ${OLLAMA_HOST:-http://host.docker.internal:11434}
|
|
|
|
services:
|
|
web:
|
|
build: .
|
|
ports:
|
|
- "5000:5000"
|
|
volumes:
|
|
- physcom-data:/app/data
|
|
environment:
|
|
<<: *env
|
|
FLASK_SECRET_KEY: ${FLASK_SECRET_KEY:-}
|
|
# Visitors are read-only; log in at /login with this token to edit or run.
|
|
PHYSCOM_ADMIN_TOKEN: ${PHYSCOM_ADMIN_TOKEN:-}
|
|
PHYSCOM_SECURE_COOKIES: ${PHYSCOM_SECURE_COOKIES:-0}
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
restart: unless-stopped
|
|
|
|
cli:
|
|
build: .
|
|
volumes:
|
|
- physcom-data:/app/data
|
|
environment: *env
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
entrypoint: ["physcom"]
|
|
profiles: [cli]
|
|
|
|
volumes:
|
|
physcom-data:
|