feat(service): add healthchecks to evolution-api service (#6607)

This commit is contained in:
desarrollonextpro 2026-01-04 15:52:05 -05:00 committed by GitHub
parent 5899b4b241
commit c5ba28b686
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1604 additions and 6482 deletions

File diff suppressed because it is too large Load diff

View file

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