DeutschLernen/docker-compose.yml
Lasse Rune Hansen 79a59bccc4 feat(backend/infra): add Docker configuration for Phase 3
- Create Dockerfile for backend (.NET 9.0 multi-stage build)
- Create Dockerfile for frontend (Node + Nginx multi-stage build)
- Create nginx.conf for frontend with API proxy
- Create docker-compose.yml with db, backend, frontend services
- Add .dockerignore files for backend, frontend, and root
- Configure health checks for all services
- Configure PostgreSQL volume for persistent data

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-05 11:46:27 +02:00

68 lines
1.6 KiB
YAML

version: '3.8'
services:
# PostgreSQL Database
db:
image: postgres:15-alpine
container_name: deutschlernen-db
environment:
POSTGRES_DB: DeutschLernen
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d DeutschLernen"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
# Backend API
backend:
build:
context: ./GermanApp
dockerfile: Dockerfile
container_name: deutschlernen-backend
environment:
ASPNETCORE_ENVIRONMENT: Development
ASPNETCORE_URLS: http://+:8080
ConnectionStrings__DefaultConnection: Host=db;Port=5432;Database=DeutschLernen;Username=postgres;Password=postgres
depends_on:
db:
condition: service_healthy
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
restart: unless-stopped
# Frontend
frontend:
build:
context: ./german-app-frontend
dockerfile: Dockerfile
container_name: deutschlernen-frontend
environment:
NODE_ENV: production
depends_on:
backend:
condition: service_healthy
ports:
- "3000:3000"
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
restart: unless-stopped
volumes:
postgres_data: