version: '3.8'

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "8080:8080"
      - "50051:50051"
    depends_on:
      - postgres
      - redis
    environment:
      - HOST=0.0.0.0
      - PORT=8080
      - DATABASE_URL=postgres://postgres:password@postgres/bluesmoke_ai
      - REDIS_URL=redis://redis:6379
      - GRPC_HOST=0.0.0.0
      - GRPC_PORT=50051
    networks:
      - bluesmoke-network
    restart: unless-stopped

  postgres:
    image: postgres:15
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=bluesmoke_ai
    volumes:
      - postgres-data:/var/lib/postgresql/data
    networks:
      - bluesmoke-network
    restart: unless-stopped

  redis:
    image: redis:7
    ports:
      - "6379:6379"
    volumes:
      - redis-data:/data
    networks:
      - bluesmoke-network
    restart: unless-stopped

networks:
  bluesmoke-network:
    driver: bridge

volumes:
  postgres-data:
  redis-data: