feat(deploy): ausgehender HTTP(S)-Proxy für Build und Laufzeit
- Compose reicht HTTP_PROXY/HTTPS_PROXY/NO_PROXY als Build-Argumente an beide Images weiter (npm ci, Google Fonts) und zur Laufzeit an api und worker; api, db, web stehen immer in NO_PROXY - Spielerköpfe werden über undici EnvHttpProxyAgent geladen (Node-fetch ignoriert Proxy-Variablen) - Doku: Proxy-Abschnitt mit Whitelist und Fehlerbildern - geprüft mit lokalem Squid: Build nur über registry.npmjs.org, fonts.googleapis.com, fonts.gstatic.com; zur Laufzeit nur mc-heads.net Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e66f89f49e
commit
d45d1821df
10 files changed
+179
-4
No files matched your search
@@ -7,6 +7,13 @@ TRAEFIK_CERTRESOLVER=letsencrypt
|
||||
# Öffentliche IP(s) des Mine-Hoster-Gameservers, kommagetrennt (CIDR). Nur sie dürfen /api/ingest erreichen.
|
||||
INGEST_ALLOWED_IPS=203.0.113.10/32
|
||||
|
||||
# ---- Ausgehender Proxy (optional) ------------------------------------------
|
||||
# Für Build (npm, Google Fonts) und Spielerköpfe. Leer lassen, wenn der Server direkt ins Internet darf.
|
||||
# Die Proxy-Einstellung des Docker-Daemons (systemd) gilt nur für Image-Pulls und reicht dafür nicht.
|
||||
HTTP_PROXY=
|
||||
HTTPS_PROXY=
|
||||
NO_PROXY=localhost,127.0.0.1,.local
|
||||
|
||||
# ---- Datenbank -------------------------------------------------------------
|
||||
POSTGRES_PASSWORD=bitte-ein-langes-zufaelliges-passwort
|
||||
BACKUP_KEEP_DAYS=14
|
||||
|
||||
@@ -7,15 +7,31 @@
|
||||
|
||||
name: atm10-stats
|
||||
|
||||
# Outbound proxy (e.g. Squid in the DMZ). The Docker daemon's own proxy setting only covers image pulls;
|
||||
# RUN steps in the build (npm, Google Fonts) and the running API need it passed explicitly.
|
||||
x-proxy-build-args: &proxy-build-args
|
||||
HTTP_PROXY: ${HTTP_PROXY:-}
|
||||
HTTPS_PROXY: ${HTTPS_PROXY:-}
|
||||
NO_PROXY: ${NO_PROXY:-}
|
||||
http_proxy: ${HTTP_PROXY:-}
|
||||
https_proxy: ${HTTPS_PROXY:-}
|
||||
no_proxy: ${NO_PROXY:-}
|
||||
|
||||
x-backend: &backend
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: backend/Dockerfile
|
||||
args: *proxy-build-args
|
||||
image: atm10-stats/backend:latest
|
||||
restart: unless-stopped
|
||||
env_file: ${ENV_FILE:-.env}
|
||||
environment:
|
||||
DATABASE_URL: postgres://atm:${POSTGRES_PASSWORD}@db:5432/atm
|
||||
# Player heads (mc-heads.net) go through the proxy; Compose-internal names and the database never do.
|
||||
# SFTP to the game server is a direct SSH connection and does not use these variables.
|
||||
HTTP_PROXY: ${HTTP_PROXY:-}
|
||||
HTTPS_PROXY: ${HTTPS_PROXY:-}
|
||||
NO_PROXY: ${NO_PROXY:-localhost,127.0.0.1},api,db,web
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
@@ -71,6 +87,7 @@ services:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: web/Dockerfile
|
||||
args: *proxy-build-args
|
||||
image: atm10-stats/web:latest
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
|
||||
Reference in new issue
Block a user