From 50b47490ededee303bdfb04ec765c3b0d8eb0070 Mon Sep 17 00:00:00 2001 From: Michael lima Date: Sat, 28 Jun 2025 23:14:47 -0400 Subject: [PATCH] fix redis and db hostname and services --- .env.example | 4 ++-- docker-compose.dev.yaml | 30 ++++++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index 1f44e9a8..c953fd2c 100644 --- a/.env.example +++ b/.env.example @@ -29,7 +29,7 @@ DEL_INSTANCE=false # Provider: postgresql | mysql DATABASE_PROVIDER=postgresql -DATABASE_CONNECTION_URI='postgresql://user:pass@postgres:5432/evolution?schema=public' +DATABASE_CONNECTION_URI='postgresql://user:pass@api_db:5432/evolution?schema=public' # Client name for the database connection # It is used to separate an API installation from another that uses the same database. DATABASE_CONNECTION_CLIENT_NAME=evolution_exchange @@ -235,7 +235,7 @@ EVOAI_ENABLED=false # Cache - Environment variables # Redis Cache enabled CACHE_REDIS_ENABLED=true -CACHE_REDIS_URI=redis://localhost:6379/6 +CACHE_REDIS_URI=redis://api_redis:6379/6 CACHE_REDIS_TTL=604800 # Prefix serves to differentiate data from one installation to another that are using the same redis CACHE_REDIS_PREFIX_KEY=evolution diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml index 2ca3424e..11d19bf0 100644 --- a/docker-compose.dev.yaml +++ b/docker-compose.dev.yaml @@ -1,13 +1,12 @@ services: api: - container_name: evolution_api + container_name: api image: evolution/api:local build: . - restart: always ports: - 8080:8080 volumes: - - evolution_instances:/evolution/instances + - instances:/evolution/instances networks: - evolution-net env_file: @@ -15,8 +14,31 @@ services: expose: - 8080 + api_db: + image: postgres:16 + environment: + - POSTGRES_USER=user + - POSTGRES_PASSWORD=pass + - POSTGRES_DB=evolution + networks: + - evolution-net + volumes: + - api_db:/var/lib/postgresql/data + + + api_redis: + image: redis:7.2.5-alpine + networks: + - evolution-net + command: redis-server --port 6379 --appendonly yes + volumes: + - api_redis:/data + + volumes: - evolution_instances: + instances: + api_redis: + api_db: networks: