Dockerfile 665 B

123456789101112131415161718192021222324252627282930313233
  1. # Build stage
  2. FROM node:16-alpine AS build
  3. WORKDIR /app
  4. COPY package*.json ./
  5. RUN npm ci --only-production
  6. COPY . .
  7. RUN npm run build
  8. # Production stage
  9. FROM node:16-alpine
  10. WORKDIR /app
  11. ENV npm_config_cache /home/node/.npm
  12. COPY package*.json ./
  13. RUN npm ci --only-production && npm cache clean --force
  14. COPY --from=build /app .
  15. RUN apk add --no-cache bash curl && curl -1sLf \
  16. 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.alpine.sh' | bash \
  17. && apk add infisical=0.8.1 && apk add --no-cache git
  18. HEALTHCHECK --interval=10s --timeout=3s --start-period=10s \
  19. CMD node healthcheck.js
  20. EXPOSE 4000
  21. CMD ["node", "build/index.js"]