From 5a0b309ca87ed2b748af5dd942e7e40c079dc3e0 Mon Sep 17 00:00:00 2001 From: xliee Date: Sun, 2 Feb 2025 14:45:49 +0100 Subject: [PATCH] Add nginx shared media volume and configure media location. This fixes an issue when accessing/saving the cfg assets and stores the media assets in a volume making the assets persist when the container changess fixes safe-global/safe-infrastructure#174 --- docker-compose.yml | 3 +++ docker/nginx/nginx.conf | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index f78f2d6..ff59424 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,7 @@ volumes: nginx-shared-txs: nginx-shared-cfg: + nginx-shared-media: x-healthcheck-db-template: &pghealthcheck healthcheck: @@ -33,6 +34,7 @@ services: - ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro - nginx-shared-txs:/nginx-txs - nginx-shared-cfg:/nginx-cfg + - nginx-shared-media:/cfg-media depends_on: - txs-web - cfg-web @@ -143,6 +145,7 @@ services: tty: true volumes: - nginx-shared-cfg:/nginx + - nginx-shared-media:/app/src/media env_file: - container_env_files/cfg.env depends_on: diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf index 9403ef2..0ad4b23 100644 --- a/docker/nginx/nginx.conf +++ b/docker/nginx/nginx.conf @@ -112,6 +112,11 @@ http { expires 365d; } + location /cfg/media { + alias /cfg-media; + expires 365d; + } + location /cfg/ { proxy_set_header Host $host; proxy_set_header X-Forwarded-Host $server_name;