Skip to content
8 changes: 6 additions & 2 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,15 @@ RUN groupadd --gid 1001 nodejs && \
useradd --uid 1001 --gid nodejs --shell /bin/bash --create-home nuxt && \
chown -R nuxt:nodejs /app

RUN mkdir -p /app/heapdumps && chown nuxt:nodejs /app/heapdumps

Comment thread
epipav marked this conversation as resolved.
Comment thread
epipav marked this conversation as resolved.
Comment on lines 84 to +87
USER nuxt

EXPOSE 3000

ENV NODE_OPTIONS=--max-old-space-size=3072

# Use exec form for proper signal handling
CMD ["node", ".output/server/index.mjs"]
# Heap snapshots are opt-in: set HEAP_SNAPSHOT_ENABLED=1 to activate.
# When enabled, cd into the heapdumps volume mount so snapshots land there.
Comment thread
epipav marked this conversation as resolved.
# exec replaces sh with node for proper signal handling.
CMD ["/bin/sh", "-c", "if [ \"$HEAP_SNAPSHOT_ENABLED\" = \"1\" ] || [ \"$HEAP_SNAPSHOT_ENABLED\" = \"true\" ]; then cd /app/heapdumps && exec node --heapsnapshot-near-heap-limit=3 --heapsnapshot-signal=SIGUSR2 /app/.output/server/index.mjs; else exec node /app/.output/server/index.mjs; fi"]
Comment on lines +95 to +97
Comment on lines +94 to +97
Loading