Skip to content

Commit b74060c

Browse files
committed
fix: prevent overwriting sentry node options
1 parent 770fa04 commit b74060c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎apps/frontend/Dockerfile‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ ENV HOST=0.0.0.0
7979
ENV PORT=3000
8080
ENV NODE_COMPILE_CACHE=/app/.node-compile-cache
8181
ENV NO_COLOR=1
82-
# Sentry has to load before the server so its instrumentation can patch modules as they are imported.
83-
ENV NODE_OPTIONS=--import=/app/.output/server/sentry.server.config.mjs
8482

8583
WORKDIR /app
8684

@@ -93,7 +91,7 @@ COPY --chown=node:node .output ./.output
9391
RUN bash <<'EOF'
9492
set -eum
9593

96-
node /app/.output/server/index.mjs &
94+
node --import /app/.output/server/sentry.server.config.mjs /app/.output/server/index.mjs &
9795
server_pid=$!
9896

9997
waited=0
@@ -122,4 +120,6 @@ EOF
122120
EXPOSE 3000
123121

124122
ENTRYPOINT ["dumb-init", "--", "/usr/local/bin/entrypoint.sh"]
125-
CMD ["node", "/app/.output/server/index.mjs"]
123+
# Sentry has to load before the server so its instrumentation can patch modules as they are imported.
124+
# It goes on the command line rather than NODE_OPTIONS, so NODE_OPTIONS stays free for runtime flags.
125+
CMD ["node", "--import", "/app/.output/server/sentry.server.config.mjs", "/app/.output/server/index.mjs"]

0 commit comments

Comments
 (0)