diff --git a/inventaire/Dockerfile.inventaire b/inventaire/Dockerfile.inventaire index 09156b1..888c9b6 100644 --- a/inventaire/Dockerfile.inventaire +++ b/inventaire/Dockerfile.inventaire @@ -30,10 +30,10 @@ RUN npm ci \ && npm ci --omit=dev --ignore-scripts \ && npm cache clean --force -WORKDIR /opt/inventaire +COPY docker-entrypoint.sh /opt/docker-entrypoint.sh -COPY docker-entrypoint.sh docker-entrypoint.sh +WORKDIR /opt/inventaire # Avoid using npm script to start the server # See https://adambrodziak.pl/dockerfile-good-practices-for-node-and-npm#heading-use-node-not-npm-to-start-the-server -ENTRYPOINT [ "./docker-entrypoint.sh" ] +ENTRYPOINT [ "/opt/docker-entrypoint.sh" ] diff --git a/inventaire/docker-entrypoint.sh b/inventaire/docker-entrypoint.sh index bc1810c..f637fc5 100755 --- a/inventaire/docker-entrypoint.sh +++ b/inventaire/docker-entrypoint.sh @@ -2,6 +2,8 @@ set -eu +cd /opt/inventaire + # Overwrite the local-${NODE_ENV} config with environment variables every time the container is restarted cat > "./config/local-${NODE_ENV}.cjs" << EOF module.exports = {