fix(infra): make IMGPROXY_URL_MAPPING configurable via environment variables

This ensures that the image proxy correctly maps public domains to internal
Docker hostnames across different environments (testing, staging, production)
without manual configuration of the docker-compose.yml file.
This commit is contained in:
2026-02-18 11:57:03 +01:00
parent e5b414ea76
commit e0fae20835
2 changed files with 4 additions and 1 deletions

View File

@@ -57,6 +57,9 @@ SENTRY_DSN=
IMAGE_TAG=latest
TRAEFIK_HOST=klz-cables.com
ENV_FILE=.env
# IMGPROXY_URL_MAPPING is used to map public domains to internal Docker hostnames
# Example for testing: https://testing.klz-cables.com/:http://klz-app:3000/,https://cms.testing.klz-cables.com/:http://klz-cms:8055/
IMGPROXY_URL_MAPPING=
# ────────────────────────────────────────────────────────────────────────────
# Varnish Configuration

View File

@@ -164,7 +164,7 @@ services:
- "cms.klz.localhost:host-gateway"
- "host.docker.internal:host-gateway"
environment:
IMGPROXY_URL_MAPPING: "http://klz.localhost/:http://klz-app:3000/,http://cms.klz.localhost/:http://klz-cms:8055/"
IMGPROXY_URL_MAPPING: "${IMGPROXY_URL_MAPPING:-http://klz.localhost/:http://klz-app:3000/,http://cms.klz.localhost/:http://klz-cms:8055/}"
IMGPROXY_USE_ETAG: "true"
IMGPROXY_MAX_SRC_RESOLUTION: 20
IMGPROXY_ALLOWED_NETWORKS: "10.0.0.0/8,172.16.0.0/12,192.168.0.0/16"