name: web-ai-services

services:
  insta-render:
    build:
      context: ./insta-render
    container_name: insta-render
    restart: unless-stopped
    ports:
      - "18710:8000"
    environment:
      - TZ=Asia/Seoul
      - REDIS_URL=${REDIS_URL:-redis://192.168.45.54:6379}
      - NAS_BASE_URL=${NAS_BASE_URL:-http://192.168.45.54:18700}
      - INTERNAL_API_KEY=${INTERNAL_API_KEY:-}
      - INSTA_MEDIA_ROOT=${INSTA_MEDIA_ROOT:-/mnt/nas/webpage/data/insta}
      - INSTA_MEDIA_URL_PREFIX=${INSTA_MEDIA_URL_PREFIX:-/media/insta}
      - CARD_TEMPLATE_DIR=/app/templates
    volumes:
      - /mnt/nas/webpage/data/insta:/mnt/nas/webpage/data/insta
    healthcheck:
      test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
      interval: 60s
      timeout: 5s
      retries: 3
