services:
  cache:
    image: redis:8.0.1
    restart: always
    ports:
      - 6379:6379
    environment:
      - REDIS_PASSWORD=123456
      - REDIS_PORT=6379
      - REDIS_DATABASES=redis
    networks:
      - app_network

  db_postgres:
    image: postgres:16.9
    environment:
      - POSTGRES_PASSWORD=senha
      - POSTGRES_USER=user
      - POSTGRES_DB=db_name
    ports:
      - 5432:5432
    networks:
      - app_network
    healthcheck:
      test: ["CMD-SHELL", "psql -U user -d db_name -c 'SELECT 1' || exit 1"]
      interval: 10s
      timeout: 3s
      retries: 3

networks:
  app_network:


