# Docker Compose configuration for local development and testing
version: '3.8'

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: figurative-ai-dev
    restart: unless-stopped
    ports:
      - "3000:3000"
    volumes:
      # Mount uploads directory for persistent storage
      - ./uploads:/app/public/uploads
    environment:
      - NODE_ENV=production
      - NANO_BANANA_KEY=${NANO_BANANA_KEY}
      - UPLOAD_DIR=/app/public/uploads
      - HOSTNAME=0.0.0.0
      - PORT=3000
    healthcheck:
      test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/api/generate', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s
