From 38cf6a8d755b06efba9f5ff580e84d1cd2bbdd24 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Wed, 18 Feb 2026 11:57:03 +0100 Subject: [PATCH] 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. --- .env.example | 3 +++ docker-compose.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index c6e998e8..daed0d2b 100644 --- a/.env.example +++ b/.env.example @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index a074f861..869f5887 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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"