From cc0aef054cf670a18d5668656572d8b615006f0b Mon Sep 17 00:00:00 2001 From: AdrienPoupa Date: Tue, 12 Aug 2025 22:41:40 -0400 Subject: [PATCH] fix(tandoor): Fix Tandoor for V2 --- tandoor/docker-compose.yml | 20 +------------------- tandoor/nginx/recipes.conf | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/tandoor/docker-compose.yml b/tandoor/docker-compose.yml index 0baa1f8..e5ce7b3 100644 --- a/tandoor/docker-compose.yml +++ b/tandoor/docker-compose.yml @@ -8,30 +8,12 @@ services: volumes: - ${CONFIG_ROOT:-.}/tandoor/database:/opt/recipes/database - ${CONFIG_ROOT:-.}/tandoor/mediafiles:/opt/recipes/mediafiles + - ${CONFIG_ROOT:-.}/tandoor/nginx:/opt/recipes/http.d - tandoor-staticfiles:/opt/recipes/staticfiles healthcheck: test: ["CMD", "wget", "http://127.0.0.1:8080/recipes", "-qO", "/dev/null"] interval: 1m retries: 10 - profiles: - - tandoor - - tandoor-nginx: - image: public.ecr.aws/nginx/nginx:mainline-alpine - container_name: tandoor-nginx - restart: always - env_file: - - ${CONFIG_ROOT:-.}/tandoor/.env - volumes: - - ${CONFIG_ROOT:-.}/tandoor/nginx:/etc/nginx/conf.d:ro - - ${CONFIG_ROOT:-.}/tandoor/mediafiles:/media:ro - - tandoor-staticfiles:/static:ro - healthcheck: - test: ["CMD", "wget", "http://127.0.0.1/recipes", "-qO", "/dev/null"] - interval: 1m - retries: 10 - depends_on: - - tandoor labels: - traefik.enable=true - traefik.http.routers.tandoor.rule=(Host(`${HOSTNAME}`) && PathPrefix(`/recipes`)) diff --git a/tandoor/nginx/recipes.conf b/tandoor/nginx/recipes.conf index 542a41d..fc25281 100644 --- a/tandoor/nginx/recipes.conf +++ b/tandoor/nginx/recipes.conf @@ -5,12 +5,20 @@ server { client_max_body_size 128M; # serve media files - location /recipes/media/ { - alias /media/; + location /recipes/media { + alias /opt/recipes/mediafiles; + add_header Content-Disposition 'attachment; filename="$args"'; } - location /recipes/static/ { - alias /static/; + + location /recipes/static { + alias /opt/recipes/staticfiles; } + + # serve service worker under main path + location = /recipes/service-worker.js { + alias /opt/recipes/staticfiles/vue3/service-worker.js; + } + # pass requests for dynamic content to gunicorn location / { proxy_set_header Host $http_host;