services:
  # Backend API
  api:
    build:
      context: ./backend
      dockerfile: Dockerfile
    container_name: smartlife-api
    restart: unless-stopped
    env_file:
      - ./backend/.env
    environment:
      - REDIS_URL=redis://172.17.0.1:6379/0
      - CELERY_BROKER_URL=redis://172.17.0.1:6379/1
      - CELERY_RESULT_BACKEND=redis://172.17.0.1:6379/2
    network_mode: host
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
      interval: 30s
      timeout: 10s
      retries: 3

  # Frontend
  frontend:
    build:
      context: ./frontend
      dockerfile: Dockerfile
    container_name: smartlife-frontend
    restart: unless-stopped
    env_file:
      - ./frontend/.env.local
    environment:
      - PORT=9000
    network_mode: host
