diff --git a/Dockerfile b/Dockerfile index 5b741d6..120f6b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,4 +12,6 @@ RUN yarn config set network-timeout 300000 \ FROM nginx:alpine RUN rm -rf /usr/share/nginx/html/* COPY --from=builder /app/public /usr/share/nginx/html -CMD ["nginx", "-g", "daemon off;"] +ENV YACD_DEFAULT_BACKEND "http://127.0.0.1:9090" +ADD docker-entrypoint.sh / +CMD ["/docker-entrypoint.sh"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 0000000..68ae7b1 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/sh +sed -i "s|http://127.0.0.1:9090|$YACD_DEFAULT_BACKEND|" /usr/share/nginx/html/index.html +nginx -g "daemon off;"