chore: add health check in docker file

pull/90/head
moonrailgun 2 years ago
parent ab6dc6275d
commit 16f04235da

@ -40,5 +40,8 @@ RUN pnpm build
# web static service port
EXPOSE 3000
# health check
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD wget localhost:3000/health -q -O - > /dev/null 2>&1
# Start server, ENV var is necessary
CMD ["pnpm", "start:service"]

@ -17,12 +17,6 @@ services:
- "traefik.enable=true"
- "traefik.http.routers.api-gw.rule=PathPrefix(`/`)"
- "traefik.http.services.api-gw.loadbalancer.server.port=3000"
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:3000/health" ]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
networks:
- internal

Loading…
Cancel
Save