Files
vollversammlung/docker-compose.yaml
T

148 lines
4.3 KiB
YAML

services:
postgres-db:
image: postgres:16-alpine
container_name: vv-postgres-db
environment:
POSTGRES_DB: vollversammlung
POSTGRES_USER: vv_admin
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
volumes:
- pg_data:/var/lib/postgresql/data
networks:
- vollversammlung_net
healthcheck:
test: ["CMD-SHELL", "pg_isready -U vv_admin -d vollversammlung"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
secrets:
- db_password
symfony-fpm:
build:
context: ./api
dockerfile: Dockerfile.dev
container_name: vv-symfony-fpm
volumes:
- ./api/src:/app/src
- ./api/public:/app/public
- symfony_var:/app/var
environment:
DATABASE_URL: "postgresql://vv_admin:${DB_PASSWORD}@postgres-db:5432/vollversammlung?serverVersion=16&charset=utf8mb4"
MERCURE_PUBLISHER_JWT_KEY: ${MERCURE_PUBLISHER_JWT_KEY}
MERCURE_SUBSCRIBER_JWT_KEY: ${MERCURE_SUBSCRIBER_JWT_KEY}
MERCURE_URL: "http://mercure-hub/.well-known/mercure"
MERCURE_PUBLIC_URL: "${MERCURE_PUBLIC_URL:-http://localhost:3000/.well-known/mercure}"
APP_ENV: "${APP_ENV:-dev}"
APP_DEBUG: "${APP_DEBUG:-1}"
APP_SECRET: ${APP_SECRET}
OAUTH_PROVIDER_NAME: "${OAUTH_PROVIDER_NAME:-vonova}"
OAUTH_AUTHORIZATION_ENDPOINT: "${OAUTH_AUTHORIZATION_ENDPOINT:-https://oauth.vonova.de/oauth/authorize}"
OAUTH_TOKEN_ENDPOINT: "${OAUTH_TOKEN_ENDPOINT:-https://oauth.vonova.de/oauth/token}"
OAUTH_CLIENT_ID: "${OAUTH_CLIENT_ID}"
OAUTH_CLIENT_SECRET: "${OAUTH_CLIENT_SECRET}"
OAUTH_REDIRECT_URI: "${OAUTH_REDIRECT_URI:-http://localhost:8080/api/oauth/callback}"
OAUTH_SCOPES: "${OAUTH_SCOPES:-read profile mandant_id}"
MAILER_DSN: "${MAILER_DSN:-smtp://mailpit:1025}"
networks:
- vollversammlung_net
depends_on:
postgres-db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8000/api/health || exit 1"]
interval: 15s
timeout: 5s
retries: 3
start_period: 40s
nginx:
image: nginx:alpine
container_name: vv-nginx
ports:
- "8080:80"
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- vollversammlung_net
depends_on:
symfony-fpm:
condition: service_healthy
mercure-hub:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8080/api/health || exit 1"]
interval: 15s
timeout: 5s
retries: 3
mercure-hub:
image: dunglas/mercure
container_name: vv-mercure-hub
ports:
- "3000:80"
environment:
SERVER_NAME: ":80"
MERCURE_PUBLISHER_JWT_KEY: ${MERCURE_PUBLISHER_JWT_KEY}
MERCURE_SUBSCRIBER_JWT_KEY: ${MERCURE_SUBSCRIBER_JWT_KEY}
MERCURE_EXTRA_DIRECTIVES: |
$merge_headers {
"Access-Control-Allow-Origin" "*";
}
networks:
- vollversammlung_net
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost/.well-known/mercure || exit 1"]
interval: 15s
timeout: 5s
retries: 3
mailpit:
image: axllent/mailpit
container_name: vv-mailpit
ports:
- "8025:8025"
networks:
- vollversammlung_net
healthcheck:
test: ["CMD-SHELL", "nc -z localhost 1025 || exit 1"]
interval: 15s
timeout: 5s
retries: 3
vite-dev:
build:
context: ./frontend
dockerfile: Dockerfile.dev
container_name: vv-vite-dev
volumes:
- ./frontend/src:/app/src
- ./frontend/public:/app/public
ports:
- "5173:5173"
environment:
VITE_API_URL: "http://nginx:80/api"
VITE_MERCURE_URL: "http://mercure-hub/.well-known/mercure"
VITE_API_URL: ${VITE_API_URL:-http://nginx:80/api}
VITE_MERCURE_URL: ${VITE_MERCURE_URL:-http://mercure-hub/.well-known/mercure}
VITE_OAUTH_AUTHORIZATION_ENDPOINT: "${VITE_OAUTH_AUTHORIZATION_ENDPOINT:-https://oauth.vonova.de/oauth/authorize}"
VITE_OAUTH_TOKEN_ENDPOINT: "${VITE_OAUTH_TOKEN_ENDPOINT:-https://oauth.vonova.de/oauth/token}"
networks:
- vollversammlung_net
depends_on:
nginx:
condition: service_healthy
networks:
vollversammlung_net:
driver: bridge
volumes:
pg_data:
symfony_var:
secrets:
db_password:
file: ./secrets/db_password.txt