services:
  app:
    build:
      context: .
      args:
        VITE_BACKEND_URL: https://datamedia.chinhphu.vn/api
    ports:
      - "0.0.0.0:${BACKEND_PORT:-2738}:${BACKEND_PORT:-2738}"
    env_file:
      - ./hls-player/.env
    environment:
      BACKEND_HOST: ${BACKEND_HOST:-0.0.0.0}
      BACKEND_PORT: ${BACKEND_PORT:-2738}
      FRONTEND_URL: ${FRONTEND_PUBLIC_URL:-https://datamedia.chinhphu.vn}
      FRONTEND_PUBLIC_URL: ${FRONTEND_PUBLIC_URL:-https://datamedia.chinhphu.vn}
      BACKEND_PUBLIC_URL: ${BACKEND_PUBLIC_URL:-https://datamedia.chinhphu.vn/api}
      PRIOMPT_PREVIEW_SERVER_PORT: ${PRIOMPT_PREVIEW_SERVER_PORT:-7594}
      ENABLE_LOCAL_MEDIA: ${ENABLE_LOCAL_MEDIA:-0}
      LOCAL_MEDIA_ROOT: ${LOCAL_MEDIA_ROOT:-/media}
      LOCAL_SHARES_DB_PATH: ${LOCAL_SHARES_DB_PATH:-/app/backend/data/local-shares.json}
      LOCAL_HLS_CACHE_DIR: ${LOCAL_HLS_CACHE_DIR:-/app/backend/data/hls-cache}
      UPLOADS_DIR: ${UPLOADS_DIR:-/app/backend/uploads}
    volumes:
      - app-data:/app/backend/data
      - app-uploads:/app/backend/uploads
    restart: unless-stopped

volumes:
  app-data:
  app-uploads:
