Skip to content

Commit

Permalink
chore: modify healthcheck
Browse files Browse the repository at this point in the history
remove from dockerfile because some service not provide http service
  • Loading branch information
moonrailgun committed May 22, 2023
1 parent 98cf631 commit 86d945e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,5 @@ 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"]
6 changes: 6 additions & 0 deletions docker/simple/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ services:
- "traefik.enable=true"
- "traefik.http.routers.api-gw.rule=PathPrefix(`/`)"
- "traefik.http.services.api-gw.loadbalancer.server.port=3000"
healthcheck:
test: [ "CMD", "wget", "localhost:3000/health", "-q", "-O", "-" ]
interval: 30s
timeout: 5s
retries: 5
start_period: 15s
networks:
- internal

Expand Down

0 comments on commit 86d945e

Please sign in to comment.