Another try with entrypoint rewrites

This commit is contained in:
Frikky
2024-07-26 18:25:43 +02:00
parent 94a2f4ce87
commit 4e7d03debb
3 changed files with 10 additions and 12 deletions
+4 -4
View File
@@ -43,7 +43,7 @@ COPY --from=builder /usr/src/app/certs/privkey.pem /etc/nginx/privkey.pem
# install CONFD # install CONFD
RUN apt-get update && apt-get install -y curl && apt-get clean RUN apt-get update && apt-get install -y curl && apt-get clean
COPY ./confd/templates/nginx.conf /etc/nginx/nginx.conf COPY ./confd/templates/nginx.conf /etc/nginx/nginx.conf.tmpl
## OLD CONFD THINGS (not compatible with arm) ## OLD CONFD THINGS (not compatible with arm)
#ENV CONFD_VERSION 0.16.0 #ENV CONFD_VERSION 0.16.0
@@ -51,10 +51,10 @@ COPY ./confd/templates/nginx.conf /etc/nginx/nginx.conf
# chmod +x /usr/local/bin/confd # chmod +x /usr/local/bin/confd
#COPY ./confd /etc/confd #COPY ./confd /etc/confd
# rewrite command & entrypoint with ours # rewrite command & entrypoint with ours
#COPY ./entrypoint.sh /
#ENTRYPOINT [ "/entrypoint.sh" ]
RUN export BACKEND_HOSTNAME=shuffle-backend COPY ./entrypoint.sh /
ENV BACKEND_HOSTNAME="shuffle-backend"
ENTRYPOINT [ "/entrypoint.sh" ]
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]
EXPOSE 80 EXPOSE 80
+3 -3
View File
@@ -71,8 +71,7 @@ http {
} }
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_pass http://$BACKEND_HOSTNAME:5001;
proxy_buffering off; proxy_buffering off;
proxy_http_version 1.1; proxy_http_version 1.1;
@@ -114,7 +113,8 @@ 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://$BACKEND_HOSTNAME:5001; proxy_pass http://${BACKEND_HOSTNAME}:5001;
proxy_buffering off; proxy_buffering off;
proxy_http_version 1.1; proxy_http_version 1.1;
+3 -5
View File
@@ -1,8 +1,6 @@
#!/bin/bash #!/usr/bin/env sh
set -eu
# generate configs - is this necessary? envsubst '${BACKEND_HOSTNAME}' < /etc/nginx/nginx.conf.tmpl > /etc/nginx/nginx.conf
# Removing confd if possible
#/usr/local/bin/confd -backend="env" -confdir="/etc/confd" -onetime
# run main command
exec "$@" exec "$@"