fix: set NODE_PATH for external module resolution + longer healthcheck
Nitro's rollupConfig.external leaves require('better-sqlite3') in
the bundle, but Node resolves from .output/server/ not /app/.
NODE_PATH=/app/node_modules fixes this. Also increase healthcheck
start-period to 30s with 5 retries.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,8 +9,8 @@ RUN npx nuxt build
|
|||||||
RUN apk del make g++ && rm -rf /root/.cache /tmp/*
|
RUN apk del make g++ && rm -rf /root/.cache /tmp/*
|
||||||
RUN mkdir -p /data && chown node:node /data
|
RUN mkdir -p /data && chown node:node /data
|
||||||
USER node
|
USER node
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production NODE_PATH=/app/node_modules
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=15s \
|
HEALTHCHECK --interval=10s --timeout=5s --retries=5 --start-period=30s \
|
||||||
CMD wget -q --spider http://localhost:3000/api/health || exit 1
|
CMD wget -q --spider http://localhost:3000/api/health || exit 1
|
||||||
ENTRYPOINT ["node", ".output/server/index.mjs"]
|
ENTRYPOINT ["node", ".output/server/index.mjs"]
|
||||||
|
|||||||
Reference in New Issue
Block a user