From 016a313cf6c54dab7ee719ed90a5564ae881776e Mon Sep 17 00:00:00 2001 From: Cian Hughes Date: Tue, 3 Jun 2025 11:27:03 +0100 Subject: [PATCH] Added paths for caddy to directly dispatch static assets --- caddy/development/Caddyfile | 5 +++++ caddy/production/Caddyfile | 5 +++++ docker-compose.yaml | 1 + 3 files changed, 11 insertions(+) diff --git a/caddy/development/Caddyfile b/caddy/development/Caddyfile index 262dbd6..d70d716 100644 --- a/caddy/development/Caddyfile +++ b/caddy/development/Caddyfile @@ -3,6 +3,11 @@ } localhost { + handle /static/* { + root * /var/www/static/ + file_server + } + reverse_proxy invenio-rdm:5000 { header_down Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0" header_down Pragma "no-cache" diff --git a/caddy/production/Caddyfile b/caddy/production/Caddyfile index 1f8c574..71880c7 100644 --- a/caddy/production/Caddyfile +++ b/caddy/production/Caddyfile @@ -3,6 +3,11 @@ } invenio.i-form.ie { + handle /static/* { + root * /var/www/ + file_server + } + reverse_proxy invenio-rdm:5000 encode gzip } diff --git a/docker-compose.yaml b/docker-compose.yaml index f6c6085..3afc62a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -12,6 +12,7 @@ services: volumes: - caddy_data:/data - ./caddy/${INVENIO_ENV}:/etc/caddy + - site_data:/var/www:ro restart: unless-stopped labels: - "io.containers.autoupdate=registry"