feat: add Docker support with multi-stage build and compose profiles

Multi-stage Dockerfile (base/dev/prod) using uv for fast installs.
Dev stage supports hot-reload via bind-mounted source; prod stage
builds an optimised image with 4 uvicorn workers. docker-compose.yml
provides 'dev' and 'prod' profiles with named volumes for data.
This commit is contained in:
Johan Lundberg 2026-02-16 14:59:50 +01:00
parent c381896de4
commit 020e6c6fa0
No known key found for this signature in database
GPG key ID: A6C152738D03C7D1
3 changed files with 98 additions and 0 deletions

34
docker-compose.yml Normal file
View file

@ -0,0 +1,34 @@
services:
app:
build:
context: .
target: prod
ports:
- "8000:8000"
environment:
OIDC_OP_ISSUER: "http://localhost:8000"
OIDC_OP_SESSION_SECRET: "change-me-in-production"
volumes:
- app-data:/app/data
profiles:
- prod
app-dev:
build:
context: .
target: dev
ports:
- "8000:8000"
environment:
OIDC_OP_ISSUER: "http://localhost:8000"
OIDC_OP_DEBUG: "true"
volumes:
- ./src:/app/src
- ./pyproject.toml:/app/pyproject.toml
- dev-data:/app/data
profiles:
- dev
volumes:
app-data:
dev-data: