services:
  web:
    build:
      context: .
      dockerfile: Dockerfile
      platforms:
        - linux/amd64
        - linux/arm64
    image: bogerserge/nini-artgallery:latest
    container_name: nini-artgallery
    restart: unless-stopped
    read_only: true
    ports:
      - "3000:3000"
    volumes:
      # User-writable data directory
      - ./data:/app/data
      # Temporary directories for Next.js cache
      - /tmp
      - /app/.next/cache
    environment:
      - NODE_ENV=production
      # Required for SEO metadata, Open Graph, and absolute URLs in emails
      - NEXT_PUBLIC_BASE_URL=https://your-domain.com
      # Admin SMTP Configuration - Configure these in production
      - ADMIN_EMAIL=admin@example.com
      - SMTP_HOST=smtp.example.com
      - SMTP_PORT=587
      - SMTP_USER=smtp-user@example.com
      - SMTP_PASS=your-smtp-password
      - SMTP_FROM_NAME="Your Gallery Name"
      - SMTP_SECURE=false
      - SMTP_REQUIRE_TLS=true
      - JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
      # OpenRouter AI Chat - Get your key at https://openrouter.ai/keys
      - OPENROUTER_API_KEY=your-openrouter-api-key
    healthcheck:
      test:
        [
          "CMD",
          "wget",
          "--no-verbose",
          "--tries=1",
          "--spider",
          "http://127.0.0.1:3000/api/health",
        ]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
