version: '3.8'

services:
  backend:
    build:
      context: ./backend
      dockerfile: Dockerfile
    container_name: shorts-maker-backend
    restart: unless-stopped
    environment:
      - OPENAI_API_KEY=${OPENAI_API_KEY}
      - WHISPER_MODEL=${WHISPER_MODEL:-medium}
      - REDIS_URL=redis://redis:6379/0
    volumes:
      - ./data/downloads:/app/data/downloads
      - ./data/processed:/app/data/processed
      - ./data/bgm:/app/data/bgm
      - ./data/jobs.json:/app/data/jobs.json
    depends_on:
      - redis
    networks:
      - shorts-network

  frontend:
    build:
      context: ./frontend
      dockerfile: Dockerfile
    container_name: shorts-maker-frontend
    restart: unless-stopped
    ports:
      - "${PORT:-3000}:80"
    depends_on:
      - backend
    networks:
      - shorts-network

  redis:
    image: redis:7-alpine
    container_name: shorts-maker-redis
    restart: unless-stopped
    volumes:
      - redis-data:/data
    networks:
      - shorts-network

volumes:
  redis-data:

networks:
  shorts-network:
    driver: bridge
