- Backend-Container mit Dockerfile aus server/backend/ - Postgres healthcheck damit Backend erst startet wenn DB bereit ist - uploads-Volume für hochgeladene Dateien - MORZ_INFOBOARD_DATABASE_URL zeigt auf postgres-Service Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
44 lines
1 KiB
YAML
44 lines
1 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
environment:
|
|
POSTGRES_DB: morz_infoboard
|
|
POSTGRES_USER: morz_infoboard
|
|
POSTGRES_PASSWORD: morz_infoboard
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U morz_infoboard"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
mosquitto:
|
|
image: eclipse-mosquitto:2
|
|
ports:
|
|
- "1883:1883"
|
|
volumes:
|
|
- ./mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
|
|
|
|
backend:
|
|
build:
|
|
context: ../server/backend
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "8080:8080"
|
|
environment:
|
|
MORZ_INFOBOARD_HTTP_ADDR: ":8080"
|
|
MORZ_INFOBOARD_DATABASE_URL: "postgres://morz_infoboard:morz_infoboard@postgres:5432/morz_infoboard?sslmode=disable"
|
|
MORZ_INFOBOARD_UPLOAD_DIR: "/uploads"
|
|
volumes:
|
|
- uploads:/uploads
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres-data:
|
|
uploads:
|