generated from coop-cloud/example
fix: better healthcheck implementation
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
Closes #12
This commit is contained in:
parent
751d86dcc7
commit
dc5585ac6e
24
compose.yml
24
compose.yml
|
@ -24,6 +24,11 @@ services:
|
||||||
configs:
|
configs:
|
||||||
- source: nginx_config
|
- source: nginx_config
|
||||||
target: /etc/nginx/nginx.conf
|
target: /etc/nginx/nginx.conf
|
||||||
|
healthcheck:
|
||||||
|
test: curl -f http://app:9000/v1/api/ping || exit 1
|
||||||
|
interval: 5s
|
||||||
|
timeout: 3s
|
||||||
|
retries: 10
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
|
@ -64,11 +69,10 @@ services:
|
||||||
mode: 0555
|
mode: 0555
|
||||||
command: npm start
|
command: npm start
|
||||||
healthcheck:
|
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); } });"'
|
test: curl -f http://localhost:9000/v1/api/ping || exit 1
|
||||||
interval: 1m
|
interval: 10s
|
||||||
timeout: 30s
|
timeout: 3s
|
||||||
retries: 3
|
retries: 10
|
||||||
start_period: 1m
|
|
||||||
entrypoint: /docker-entrypoint.sh
|
entrypoint: /docker-entrypoint.sh
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
|
@ -88,6 +92,11 @@ services:
|
||||||
- postgres-data:/var/lib/postgresql/data
|
- postgres-data:/var/lib/postgresql/data
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
|
healthcheck:
|
||||||
|
test: pg_isready
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
image: redis:4-alpine
|
image: redis:4-alpine
|
||||||
|
@ -95,6 +104,11 @@ services:
|
||||||
- redis-data:/data
|
- redis-data:/data
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
|
healthcheck:
|
||||||
|
test: redis-cli ping
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
internal:
|
internal:
|
||||||
|
|
Loading…
Reference in New Issue