first commit
This commit is contained in:
55
docker-compose.yml
Normal file
55
docker-compose.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
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
|
||||
|
||||
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}
|
||||
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
|
||||
|
||||
# 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:
|
||||
Reference in New Issue
Block a user