"feat: Add SSL configuration and docker-compose updates for frontend"
This commit is contained in:
95
docker-compose.yml
Normal file
95
docker-compose.yml
Normal file
@ -0,0 +1,95 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
# Backend (Flask) auf Port 443 mit SSL
|
||||
backend:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
container_name: myp-backend
|
||||
restart: unless-stopped
|
||||
hostname: raaspberry
|
||||
ports:
|
||||
- "80:80" # HTTP Fallback
|
||||
- "443:443" # HTTPS
|
||||
volumes:
|
||||
- ./backend:/app
|
||||
- ./backend/logs:/app/logs
|
||||
- ./backend/instance:/app/instance
|
||||
- backend_ssl:/opt/myp/ssl
|
||||
networks:
|
||||
- myp-network
|
||||
environment:
|
||||
- FLASK_APP=app/app.py
|
||||
- FLASK_ENV=production
|
||||
- SSL_ENABLED=true
|
||||
- SSL_HOSTNAME=raaspberry
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-k", "https://localhost:443/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
# Next.js Frontend
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
container_name: myp-rp
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- NEXT_PUBLIC_API_URL=https://raaspberry:443
|
||||
- NEXT_PUBLIC_BACKEND_HOST=raaspberry:443
|
||||
volumes:
|
||||
- ./frontend:/app
|
||||
- /app/node_modules
|
||||
- /app/.next
|
||||
ports:
|
||||
- "3000:3000"
|
||||
networks:
|
||||
- myp-network
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--spider", "http://localhost:3000/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
# Caddy Proxy für Frontend auf Port 443 mit SSL
|
||||
caddy:
|
||||
image: caddy:2.7-alpine
|
||||
container_name: myp-caddy
|
||||
restart: unless-stopped
|
||||
hostname: m040tbaraspi001
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ./frontend/docker/caddy/Caddyfile:/etc/caddy/Caddyfile
|
||||
- caddy_data:/data
|
||||
- caddy_config:/config
|
||||
networks:
|
||||
- myp-network
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
- "raaspberry:backend"
|
||||
- "m040tbaraspi001.de040.corpintra.net:127.0.0.1"
|
||||
environment:
|
||||
- CADDY_HOST=m040tbaraspi001.de040.corpintra.net
|
||||
- CADDY_DOMAIN=m040tbaraspi001.de040.corpintra.net
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
depends_on:
|
||||
- backend
|
||||
- frontend
|
||||
|
||||
networks:
|
||||
myp-network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
caddy_data:
|
||||
caddy_config:
|
||||
backend_ssl:
|
Reference in New Issue
Block a user