"feat: Integrate Caddy as reverse proxy for frontend"

This commit is contained in:
Till Tomczak 2025-05-26 07:58:09 +02:00
parent 0e40ad1c12
commit bb10247c41
3 changed files with 8 additions and 8 deletions

View File

@ -36,7 +36,7 @@ SESSION_LIFETIME = timedelta(days=7)
SSL_ENABLED = True SSL_ENABLED = True
SSL_CERT_PATH = "/opt/myp/ssl/myp.crt" SSL_CERT_PATH = "/opt/myp/ssl/myp.crt"
SSL_KEY_PATH = "/opt/myp/ssl/myp.key" SSL_KEY_PATH = "/opt/myp/ssl/myp.key"
SSL_HOSTNAME = "raaspberry" SSL_HOSTNAME = "raspberrypi"
# Scheduler-Konfiguration # Scheduler-Konfiguration
SCHEDULER_INTERVAL = 60 # Sekunden SCHEDULER_INTERVAL = 60 # Sekunden

View File

@ -8,7 +8,7 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: myp-backend container_name: myp-backend
restart: unless-stopped restart: unless-stopped
hostname: raaspberry hostname: raspberrypi
ports: ports:
- "80:80" # HTTP Fallback - "80:80" # HTTP Fallback
- "443:443" # HTTPS - "443:443" # HTTPS
@ -23,7 +23,7 @@ services:
- FLASK_APP=app/app.py - FLASK_APP=app/app.py
- FLASK_ENV=production - FLASK_ENV=production
- SSL_ENABLED=true - SSL_ENABLED=true
- SSL_HOSTNAME=raaspberry - SSL_HOSTNAME=raspberrypi
healthcheck: healthcheck:
test: ["CMD", "curl", "-k", "https://localhost:443/health"] test: ["CMD", "curl", "-k", "https://localhost:443/health"]
interval: 30s interval: 30s
@ -40,8 +40,8 @@ services:
restart: unless-stopped restart: unless-stopped
environment: environment:
- NODE_ENV=production - NODE_ENV=production
- NEXT_PUBLIC_API_URL=https://raaspberry:443 - NEXT_PUBLIC_API_URL=https://raspberrypi:443
- NEXT_PUBLIC_BACKEND_HOST=raaspberry:443 - NEXT_PUBLIC_BACKEND_HOST=raspberrypi:443
volumes: volumes:
- ./frontend:/app - ./frontend:/app
- /app/node_modules - /app/node_modules
@ -74,7 +74,7 @@ services:
- myp-network - myp-network
extra_hosts: extra_hosts:
- "host.docker.internal:host-gateway" - "host.docker.internal:host-gateway"
- "raaspberry:backend" - "raspberrypi:backend"
- "m040tbaraspi001.de040.corpintra.net:127.0.0.1" - "m040tbaraspi001.de040.corpintra.net:127.0.0.1"
environment: environment:
- CADDY_HOST=m040tbaraspi001.de040.corpintra.net - CADDY_HOST=m040tbaraspi001.de040.corpintra.net

View File

@ -16,7 +16,7 @@ m040tbaraspi001.de040.corpintra.net {
} }
handle @api { handle @api {
uri strip_prefix /api uri strip_prefix /api
reverse_proxy raaspberry:443 { reverse_proxy raspberrypi:443 {
transport http { transport http {
tls tls
tls_insecure_skip_verify tls_insecure_skip_verify
@ -62,7 +62,7 @@ localhost, 127.0.0.1 {
} }
handle @api { handle @api {
uri strip_prefix /api uri strip_prefix /api
reverse_proxy raaspberry:443 { reverse_proxy raspberrypi:443 {
transport http { transport http {
tls tls
tls_insecure_skip_verify tls_insecure_skip_verify