From 94a2f4ce876345f6ae8185d8eb5dbd56bca9d119 Mon Sep 17 00:00:00 2001 From: Frikky Date: Fri, 26 Jul 2024 17:35:33 +0200 Subject: [PATCH] Started using pure nginx conf syntax --- frontend/Dockerfile | 4 +++- frontend/confd/templates/nginx.conf | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 32b494c6..6602208d 100755 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,6 +1,8 @@ # Build environment FROM node:21 as builder +ENV NODE_OPTIONS="--max-old-space-size=4096" + RUN mkdir /usr/src/app WORKDIR /usr/src/app ENV PATH /usr/src/app/node_modules/.bin:$PATH @@ -52,7 +54,7 @@ COPY ./confd/templates/nginx.conf /etc/nginx/nginx.conf #COPY ./entrypoint.sh / #ENTRYPOINT [ "/entrypoint.sh" ] - +RUN export BACKEND_HOSTNAME=shuffle-backend CMD ["nginx", "-g", "daemon off;"] EXPOSE 80 diff --git a/frontend/confd/templates/nginx.conf b/frontend/confd/templates/nginx.conf index 3bb02c27..a119d69d 100755 --- a/frontend/confd/templates/nginx.conf +++ b/frontend/confd/templates/nginx.conf @@ -71,7 +71,8 @@ http { } location ~ /api/v(1|2) { - proxy_pass http://{{ getenv "BACKEND_HOSTNAME" "shuffle-backend" }}:5001; + #proxy_pass http://{{ getenv "BACKEND_HOSTNAME" "shuffle-backend" }}:5001; + proxy_pass http://$BACKEND_HOSTNAME:5001; proxy_buffering off; proxy_http_version 1.1; @@ -113,7 +114,7 @@ http { # Get the hostname from environment here? location ~ /api/v(1|2) { - proxy_pass http://{{ getenv "BACKEND_HOSTNAME" "shuffle-backend" }}:5001; + proxy_pass http://$BACKEND_HOSTNAME:5001; proxy_buffering off; proxy_http_version 1.1;