mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 17:21:04 +00:00
feat(service): add healthchecks to evolution-api service (#6607)
This commit is contained in:
committed by
GitHub
parent
5899b4b241
commit
c5ba28b686
@@ -8,14 +8,16 @@
|
||||
version: '3.8'
|
||||
services:
|
||||
api:
|
||||
image: 'evoapicloud/evolution-api:latest' # Change to specific version if needed.
|
||||
restart: always
|
||||
image: 'evoapicloud/evolution-api:v2.3.4'
|
||||
depends_on:
|
||||
- redis
|
||||
- postgres
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
- SERVICE_URL_EVO_8080
|
||||
- SERVER_URL=$SERVICE_URL_EVO
|
||||
- SERVER_URL=${SERVICE_URL_EVO}
|
||||
|
||||
- DB_TYPE=${DB_TYPE:-postgresdb}
|
||||
- 'DB_POSTGRESDB_DATABASE=${POSTGRES_DB:-postgres}'
|
||||
- DB_POSTGRESDB_HOST=${DB_POSTGRESDB_HOST:-postgres}
|
||||
@@ -137,13 +139,32 @@ services:
|
||||
volumes:
|
||||
- 'evolution_instances:/evolution/instances'
|
||||
expose:
|
||||
- 8080
|
||||
- "8080"
|
||||
healthcheck:
|
||||
# Internal healthcheck: success if "/" returns 2xx (sin curl/wget)
|
||||
test:
|
||||
- CMD-SHELL
|
||||
- >
|
||||
node -e "require('http')
|
||||
.get('http://127.0.0.1:8080/',r=>process.exit(r.statusCode>=200&&r.statusCode<300?0:1))
|
||||
.on('error',()=>process.exit(1))"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 30
|
||||
start_period: 60s
|
||||
|
||||
redis:
|
||||
image: 'redis:latest'
|
||||
image: 'redis:7-alpine'
|
||||
command: "redis-server --port 6379 --appendonly yes\n"
|
||||
restart: always
|
||||
volumes:
|
||||
- 'evolution_redis:/data'
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "-h", "127.0.0.1", "ping"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 20
|
||||
start_period: 5s
|
||||
|
||||
postgres:
|
||||
image: 'postgres:16-alpine'
|
||||
command:
|
||||
@@ -155,10 +176,18 @@ services:
|
||||
- 'POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRES}'
|
||||
- 'POSTGRES_DB=${POSTGRES_DB:-postgres}'
|
||||
- 'AUTHENTICATION_API_KEY=${SERVICE_PASSWORD_AUTHENTICATIONAPIKEY}'
|
||||
restart: always
|
||||
volumes:
|
||||
- 'postgres_data:/var/lib/postgresql/data'
|
||||
healthcheck:
|
||||
test:
|
||||
- CMD-SHELL
|
||||
- 'pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB} -h 127.0.0.1'
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 20
|
||||
start_period: 10s
|
||||
|
||||
volumes:
|
||||
evolution_instances: null
|
||||
evolution_redis: null
|
||||
postgres_data: null
|
||||
evolution_instances:
|
||||
evolution_redis:
|
||||
postgres_data:
|
||||
|
||||
Reference in New Issue
Block a user