services:
  postgres:
    image: postgres:15
    container_name: evolution_postgres
    restart: always
    environment:
      POSTGRES_USER: admin
      POSTGRES_PASSWORD: Evolution0987890
      POSTGRES_DB: evolution_db
    volumes:
      - postgres_data:/var/lib/postgresql/data
    networks:
      - evolution_net

  redis:
    image: redis:latest
    container_name: evolution_redis
    restart: always
    networks:
      - evolution_net

  evolution_api:
    image: atendai/evolution-api:latest
    container_name: evolution_api
    restart: always
    depends_on:
      - postgres
      - redis
    ports:
      - "8080:8080"
    environment:
      SERVER_URL: "http://axissistemas.com.br:8080"
      AUTHENTICATION_API_KEY: "9f3a1c7e4b6d8a0c3f2e5b7d9a1c4e6f8"
      DATABASE_PROVIDER: "postgresql"
      DATABASE_CONNECTION_URI: "postgresql://admin:Evolution0987890@evolution_postgres:5432/evolution_db"
      CACHE_REDIS_ENABLED: "true"
      CACHE_REDIS_URI: "redis://evolution_redis:6379/1"
      CACHE_REDIS_PREFIX_KEY: "evolution"
      CACHE_REDIS_SAVE_INSTANCES: "false"
      CACHE_LOCAL_ENABLED: "false"
      WEBSOCKET_ENABLED: "true"
      WEBSOCKET_GLOBAL_EVENTS: "true"
      QRCODE_LIMIT: "30"
      CONFIG_SESSION_PHONE_CLIENT: "Evolution API"
      CONFIG_SESSION_PHONE_NAME: "Chrome"
    networks:
      - evolution_net

volumes:
  postgres_data:

networks:
  evolution_net:
    driver: bridge
