Files
leerdoelen_tracker/docker-compose.yml
Sam 07bcfede75
Some checks failed
Build, Push & Deploy / Build & Push image (push) Failing after 56s
Build, Push & Deploy / Deploy naar VPS (push) Has been skipped
Build & Push / Build & Push image (push) Successful in 1m2s
Add more security and audit
2026-02-28 14:47:33 +01:00

70 lines
2.4 KiB
YAML

version: '3.9'
services:
db:
image: postgres:16-alpine
container_name: leerdoelen_db
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-leerdoelen}
POSTGRES_USER: ${POSTGRES_USER:-leerdoelen}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-leerdoelen}"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: leerdoelen_redis
restart: unless-stopped
command: redis-server --save "" --appendonly no --maxmemory 64mb --maxmemory-policy allkeys-lru --requirepass ${REDIS_PASSWORD:-changeme_redis}
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-changeme_redis}", "ping"]
interval: 10s
timeout: 3s
retries: 3
backend:
# In productie: image uit de Gitea registry (gezet door CI/CD pipeline)
# Lokaal ontwikkelen: verander naar 'build: ./backend'
image: ${BACKEND_IMAGE:-leerdoelen-backend:local}
build:
context: ./backend
# 'build' wordt genegeerd als 'image' al bestaat in de registry.
# Gebruik 'docker compose build' om lokaal te (her)bouwen.
container_name: leerdoelen_backend
restart: unless-stopped
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-leerdoelen}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB:-leerdoelen}
SECRET_KEY: ${SECRET_KEY}
FLASK_ENV: ${FLASK_ENV:-production}
FLASK_APP: app.py
# OAuth2 - later in te vullen
MICROSOFT_CLIENT_ID: ${MICROSOFT_CLIENT_ID:-}
MICROSOFT_CLIENT_SECRET: ${MICROSOFT_CLIENT_SECRET:-}
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
BASE_URL: ${BASE_URL:-http://localhost}
ORG_NAME: ${ORG_NAME:-GO! Scholengroep}
REDIS_URL: redis://:${REDIS_PASSWORD:-changeme_redis}@redis:6379/0
volumes:
- ./doelen:/app/doelen:ro # JSON doelen bestanden (read-only)
ports:
- "127.0.0.1:${APP_PORT:-5000}:5000"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
# Nginx container verwijderd — SSL offloading gebeurt door de host nginx.
# Flask is bereikbaar op 127.0.0.1:${APP_PORT} van de host.
volumes:
postgres_data: