chore: simple docker compose add health check

pull/90/head
moonrailgun 2 years ago
parent da6960bdbf
commit bd5304cc5e

@ -8,15 +8,21 @@ services:
restart: unless-stopped restart: unless-stopped
env_file: ../../docker-compose.env env_file: ../../docker-compose.env
environment: environment:
SERVICEDIR: services SERVICEDIR: services,plugins
PORT: 3000 PORT: 3000
depends_on: depends_on:
- mongo - mongo
- redis - redis
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.routers.api-gw.rule=PathPrefix(`/health`)" - "traefik.http.routers.api-gw.rule=PathPrefix(`/`)"
- "traefik.http.services.api-gw.loadbalancer.server.port=3000" - "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: networks:
- internal - internal

Loading…
Cancel
Save