From 4cffed239d968d0607120e91df40bbde3bedd5e6 Mon Sep 17 00:00:00 2001 From: maxlath Date: Thu, 27 Feb 2025 19:19:42 +0100 Subject: [PATCH] inventaire container: move docker-entrypoint.sh outside of /opt/inventaire to avoid undesired interactions with the shared inventaire-server volume --- inventaire/Dockerfile.inventaire | 6 +++--- inventaire/docker-entrypoint.sh | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) 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 = {