Files
wijtransferen/docker-compose.yml
T
2026-08-22 19:34:10 +02:00

98 lines
2.7 KiB
YAML

services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: surprise
POSTGRES_USER: surprise
POSTGRES_PASSWORD: surprise_dev_password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./migrations:/migrations:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 10
minio:
image: minio/minio:latest
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${STORAGE_ACCESS_KEY:-minioadmin}
MINIO_ROOT_PASSWORD: ${STORAGE_SECRET_KEY:-minioadmin}
MINIO_API_CORS_ALLOW_ORIGIN: ${CORS_ORIGIN:-http://localhost:8081}
ports:
- "${MINIO_API_PORT:-9000}:9000"
- "${MINIO_CONSOLE_PORT:-9001}:9001"
volumes:
- minio_data:/data
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:9000/minio/health/live || exit 1"]
interval: 5s
timeout: 5s
retries: 10
api:
build: ./backend
restart: unless-stopped
ports:
- "${PORT:-8080}:8080"
environment:
DB_DRIVER: postgres
DATABASE_URL: postgres://surprise:surprise_dev_password@postgres:5432/surprise?sslmode=disable
PORT: "8080"
CORS_ORIGIN: "http://localhost:8081"
SESSION_SECRET: "${SESSION_SECRET:-docker-compose-session-secret-change-me}"
COOKIE_SECURE: "${COOKIE_SECURE:-false}"
STORAGE_ENDPOINT: "minio:9000"
STORAGE_PUBLIC_ENDPOINT: ""
STORAGE_ACCESS_KEY: "${STORAGE_ACCESS_KEY:-minioadmin}"
STORAGE_SECRET_KEY: "${STORAGE_SECRET_KEY:-minioadmin}"
STORAGE_BUCKET: "${STORAGE_BUCKET:-gallery-media}"
STORAGE_USE_SSL: "${STORAGE_USE_SSL:-false}"
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
migrate:
build: ./backend
command: ["migrate", "-dir", "/migrations"]
environment:
DB_DRIVER: postgres
DATABASE_URL: postgres://surprise:surprise_dev_password@postgres:5432/surprise?sslmode=disable
volumes:
- ./migrations:/migrations:ro
depends_on:
postgres:
condition: service_healthy
seed:
build: ./backend
command: ["seed"]
environment:
DB_DRIVER: postgres
DATABASE_URL: postgres://surprise:surprise_dev_password@postgres:5432/surprise?sslmode=disable
depends_on:
postgres:
condition: service_healthy
frontend:
build:
context: ./frontend
args:
VITE_API_BASE_URL: ""
restart: unless-stopped
ports:
- "${FRONTEND_PORT:-8081}:80"
depends_on:
- api
volumes:
postgres_data:
minio_data: