version: '3.8'

services:
  nextav:
    image: nextav:optimized
    container_name: nextav-app
    restart: unless-stopped
    ports:
      - "3000:3000"
    volumes:
      - ${DB_PATH:-./data}:/app/data
      - ${MEDIA_PATH:-./media}:/app/media
      - ${THUMBNAILS_PATH:-./public/thumbnails}:/app/public/thumbnails
      - /mnt/data1:/mnt/data1
    command: node server.js
    environment:
      - NODE_ENV=production
      - NEXT_PUBLIC_MEDIA_ROOT=${NEXT_PUBLIC_MEDIA_ROOT:-/app/media}
      - DB_FILE=/app/data/media.db
    healthcheck:
      test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:3000/api/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) })\""]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s
    networks:
      - nextav-network



networks:
  nextav-network:
    driver: bridge