Another try with entrypoint rewrites
This commit is contained in:
+4
-4
@@ -43,7 +43,7 @@ COPY --from=builder /usr/src/app/certs/privkey.pem /etc/nginx/privkey.pem
|
||||
|
||||
# install CONFD
|
||||
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)
|
||||
#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
|
||||
#COPY ./confd /etc/confd
|
||||
# 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;"]
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
@@ -71,8 +71,7 @@ http {
|
||||
}
|
||||
|
||||
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_http_version 1.1;
|
||||
|
||||
@@ -114,7 +113,8 @@ http {
|
||||
|
||||
# Get the hostname from environment here?
|
||||
location ~ /api/v(1|2) {
|
||||
proxy_pass http://$BACKEND_HOSTNAME:5001;
|
||||
proxy_pass http://${BACKEND_HOSTNAME}:5001;
|
||||
|
||||
proxy_buffering off;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
# generate configs - is this necessary?
|
||||
# Removing confd if possible
|
||||
#/usr/local/bin/confd -backend="env" -confdir="/etc/confd" -onetime
|
||||
envsubst '${BACKEND_HOSTNAME}' < /etc/nginx/nginx.conf.tmpl > /etc/nginx/nginx.conf
|
||||
|
||||
# run main command
|
||||
exec "$@"
|
||||
|
||||
Reference in New Issue
Block a user