Started using pure nginx conf syntax

This commit is contained in:
Frikky
2024-07-26 17:35:33 +02:00
parent 56d96b331a
commit 94a2f4ce87
2 changed files with 6 additions and 3 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
# Build environment # Build environment
FROM node:21 as builder FROM node:21 as builder
ENV NODE_OPTIONS="--max-old-space-size=4096"
RUN mkdir /usr/src/app RUN mkdir /usr/src/app
WORKDIR /usr/src/app WORKDIR /usr/src/app
ENV PATH /usr/src/app/node_modules/.bin:$PATH 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 / #COPY ./entrypoint.sh /
#ENTRYPOINT [ "/entrypoint.sh" ] #ENTRYPOINT [ "/entrypoint.sh" ]
RUN export BACKEND_HOSTNAME=shuffle-backend
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]
EXPOSE 80 EXPOSE 80
+3 -2
View File
@@ -71,7 +71,8 @@ http {
} }
location ~ /api/v(1|2) { 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_buffering off;
proxy_http_version 1.1; proxy_http_version 1.1;
@@ -113,7 +114,7 @@ http {
# Get the hostname from environment here? # Get the hostname from environment here?
location ~ /api/v(1|2) { location ~ /api/v(1|2) {
proxy_pass http://{{ getenv "BACKEND_HOSTNAME" "shuffle-backend" }}:5001; proxy_pass http://$BACKEND_HOSTNAME:5001;
proxy_buffering off; proxy_buffering off;
proxy_http_version 1.1; proxy_http_version 1.1;