diff --git a/Dockerfile b/Dockerfile index 9db3b818d..642994d4d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,12 +44,14 @@ COPY --from=build /app/dist/browser /usr/share/nginx/html # copy nginx config COPY ./nginx/default.conf.template /etc/nginx/templates/default.conf.template -# copy entrypoint script +# copy our custom entrypoint script COPY ./docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh # expose port: defaults to 80 EXPOSE $PORT -# run docker-entrypoint.sh +# set working directory WORKDIR /usr/share/nginx/html -CMD ["docker-entrypoint.sh"] + +# use our custom entrypoint script, to provide extra steps +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 5047e807c..414d46e33 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -30,5 +30,5 @@ if [ "$JSON" != "{}" ]; then echo "$JSON" >$JSON_PATH fi -# run nginx -nginx -g "daemon off;" +# go back to nginx's built-in entrypoint script +exec /docker-entrypoint.sh nginx -g "daemon off;"