Dockerfile 608 B

1234567891011121314151617181920212223242526
  1. FROM dev.data-turing.cn:14443/library/node:20-bookworm-slim
  2. WORKDIR /app
  3. ENV NODE_ENV=production
  4. ENV PORT=3000
  5. COPY package*.json ./
  6. RUN set -eux; \
  7. npm install --omit=dev --no-audit --no-fund --loglevel verbose; \
  8. if grep -R "Exit handler never called" /root/.npm/_logs 2>/dev/null; then \
  9. cat /root/.npm/_logs/*debug-0.log; \
  10. exit 1; \
  11. fi
  12. RUN node -e "require('express'); require('better-sqlite3'); console.log('runtime dependencies ok')"
  13. COPY src ./src
  14. COPY views ./views
  15. COPY public ./public
  16. COPY DESIGN.md ./DESIGN.md
  17. RUN mkdir -p /app/data
  18. EXPOSE 3000
  19. CMD ["node", "src/index.js"]