diff --git a/compose.yml b/compose.yml index 77649c3..3cf8c54 100644 --- a/compose.yml +++ b/compose.yml @@ -24,6 +24,11 @@ services: configs: - source: nginx_config target: /etc/nginx/nginx.conf + healthcheck: + test: curl -f http://app:9000/v1/api/ping || exit 1 + interval: 5s + timeout: 3s + retries: 10 deploy: restart_policy: condition: on-failure @@ -64,11 +69,10 @@ services: mode: 0555 command: npm start healthcheck: - test: 'nodejs -e "http.get(''http://localhost:9000/api/v1/ping'', (res) => { console.log(''status: '', res.statusCode); if (res.statusCode == 200) { process.exit(0); } else { process.exit(1); } });"' - interval: 1m - timeout: 30s - retries: 3 - start_period: 1m + test: curl -f http://localhost:9000/v1/api/ping || exit 1 + interval: 10s + timeout: 3s + retries: 10 entrypoint: /docker-entrypoint.sh networks: - internal @@ -88,6 +92,11 @@ services: - postgres-data:/var/lib/postgresql/data networks: - internal + healthcheck: + test: pg_isready + interval: 10s + timeout: 5s + retries: 10 cache: image: redis:4-alpine @@ -95,6 +104,11 @@ services: - redis-data:/data networks: - internal + healthcheck: + test: redis-cli ping + interval: 10s + timeout: 5s + retries: 10 networks: internal: