71 lines
1.8 KiB
YAML
71 lines
1.8 KiB
YAML
# 🎨 MYP Frontend - Produktionsumgebung Konfiguration
|
|
# Frontend-Service für die Produktion mit Raspberry Pi Backend
|
|
|
|
version: '3.8'
|
|
|
|
services:
|
|
# === FRONTEND SERVICE ===
|
|
frontend:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: myp-frontend
|
|
restart: unless-stopped
|
|
environment:
|
|
- NODE_ENV=production
|
|
- NEXT_PUBLIC_API_URL=https://raspberrypi
|
|
- NEXT_PUBLIC_BACKEND_HOST=raspberrypi
|
|
- NEXT_PUBLIC_FRONTEND_URL=https://m040tbaraspi001.de040.corpintra.net
|
|
- NEXTAUTH_URL=https://m040tbaraspi001.de040.corpintra.net
|
|
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET:-myp-secret-key-2024}
|
|
- GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
|
|
- GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}
|
|
- NEXT_PUBLIC_OAUTH_CALLBACK_URL=https://m040tbaraspi001.de040.corpintra.net/auth/login/callback
|
|
volumes:
|
|
- ./certs:/app/certs
|
|
ports:
|
|
- "3000:3000" # Direkter Port-Zugang für Frontend-Server
|
|
networks:
|
|
- myp-network
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
# === CADDY PROXY ===
|
|
caddy:
|
|
image: caddy:2-alpine
|
|
container_name: myp-caddy
|
|
restart: unless-stopped
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./docker/caddy/Caddyfile:/etc/caddy/Caddyfile
|
|
- ./certs:/etc/ssl/certs/myp
|
|
- caddy_data:/data
|
|
- caddy_config:/config
|
|
networks:
|
|
- myp-network
|
|
depends_on:
|
|
- frontend
|
|
environment:
|
|
- CADDY_INGRESS_NETWORKS=myp-network
|
|
|
|
# === PERSISTENTE VOLUMES ===
|
|
volumes:
|
|
caddy_data:
|
|
driver: local
|
|
caddy_config:
|
|
driver: local
|
|
|
|
# === NETZWERK ===
|
|
networks:
|
|
myp-network:
|
|
driver: bridge
|
|
labels:
|
|
- "description=MYP Production Network"
|
|
- "project=myp-frontend"
|
|
- "tier=production" |