version: '3.8'

services:
  webrtc-app:
    build: .
    ports:
      - "3000:3000"  # 映射到主机的3000端口，外网可访问
    environment:
      - NODE_ENV=production
      - PORT=3000
    volumes:
      - ./videos:/app/videos  # 挂载视频文件目录
      - ./logs:/app/logs      # 挂载日志目录
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s
    networks:
      - webrtc-network

networks:
  webrtc-network:
    driver: bridge