fix: better healthcheck implementation
continuous-integration/drone/push Build is failing Details

Closes #12
This commit is contained in:
decentral1se 2022-08-15 10:44:38 +02:00
parent 751d86dcc7
commit dc5585ac6e
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 19 additions and 5 deletions

View File

@ -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: