diff --git a/Dockerfile b/Dockerfile index 03231703e..c231a1d42 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM python:3.13-alpine3.21 #Install all dependencies. - RUN apk add --no-cache postgresql-libs postgresql-client gettext zlib libjpeg libwebp libxml2-dev libxslt-dev openldap git libgcc libstdc++ nginx +RUN apk add --no-cache postgresql-libs postgresql-client gettext zlib libjpeg libwebp libxml2-dev libxslt-dev openldap git libgcc libstdc++ nginx #Print all logs without buffering it. ENV PYTHONUNBUFFERED 1 @@ -42,7 +42,7 @@ COPY . ./ # delete default nginx config and link it to tandoors config RUN rm -rf /etc/nginx/http.d -RUN ln -s /opt/recipes/nginx/conf.d /etc/nginx/http.d +RUN ln -s /opt/recipes/http.d /etc/nginx/http.d # commented for now https://github.com/TandoorRecipes/recipes/issues/3478 #HEALTHCHECK --interval=30s \ diff --git a/http.d/Recipes.conf b/http.d/Recipes.conf new file mode 100644 index 000000000..1d9c9e721 --- /dev/null +++ b/http.d/Recipes.conf @@ -0,0 +1,31 @@ +server { + listen 80; + listen [::]:80 ipv6only=on; + server_name localhost; + + client_max_body_size 128M; + + # serve media files + location /media { + alias /opt/recipes/mediafiles; + add_header Content-Disposition 'attachment; filename="$args"'; + } + + # serve service worker under main path + location = /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; + proxy_pass http://web_recipes:8080; + + error_page 502 /errors/http502.html; + } + + location /errors/ { + alias /etc/nginx/conf.d/errorpages/; + internal; + } +} diff --git a/http.d/errorpages/http502.html b/http.d/errorpages/http502.html new file mode 100644 index 000000000..748c48e28 --- /dev/null +++ b/http.d/errorpages/http502.html @@ -0,0 +1,20 @@ + + + + + + 502 - Webservice currently unavailable + + + +

Tandoor Recipes is not yet available 502

+

+ Services are still trying to start.
+ Please allow up to 3 minutes after you started the application on your server.

+ If this status persists, check the application or docker logs for further information.
+ After checking and trying everything mentioned in the docs, you can request help on the project's GitHub page. +

+
+ + + \ No newline at end of file