23 lines
494 B
Docker
23 lines
494 B
Docker
FROM node:20-alpine
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN apk add --no-cache curl su-exec && npm install --omit=dev
|
|
|
|
COPY . .
|
|
RUN chown -R node:node /app
|
|
|
|
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
|
|
|
EXPOSE 4000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
|
CMD curl -f http://localhost:4000/health || exit 1
|
|
|
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
|
CMD ["node", "index.js"]
|