diff --git a/.dockerignore b/.dockerignore index ab2a8d67..b9672806 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,3 +4,4 @@ dist/ .* *.md !.prettier* +!.eslintrc.cjs diff --git a/Dockerfile b/Dockerfile index 03e56bcd..e9de96b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,5 +19,7 @@ FROM nginx:alpine COPY --from=build /app/dist/ /usr/share/nginx/html/ COPY docker/nginx.conf /etc/nginx/conf.d/default.conf +COPY docker/entrypoint.sh /entrypoint.sh EXPOSE 80 +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/Dockerfile.ci b/Dockerfile.ci index d020ebfc..59020fd6 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -2,5 +2,7 @@ FROM nginx:alpine COPY ./dist-ci/ /usr/share/nginx/html/ COPY docker/nginx.conf /etc/nginx/conf.d/default.conf +COPY docker/entrypoint.sh /entrypoint.sh EXPOSE 80 +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100755 index 00000000..ffb9c7ed --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ -z "$BACKEND_HOSTNAME" ]; then + echo "BACKEND_HOSTNAME not set" + exit 1 +fi + +sed -i s/pipedapi.kavin.rocks/"$BACKEND_HOSTNAME"/g /usr/share/nginx/html/assets/* +nginx -g "daemon off;"