# PhotoAI — your own photo server (Linux, Windows or Mac, with Docker) # # Guide: https://setup.photo.myphonetools.com/ # # docker compose up -d start (Ollama already running on this computer) # docker compose --profile ollama up -d start, with Ollama in a container too (Linux, NVIDIA) # COMPOSE_PROFILES in .env picks the optional parts: ollama (NVIDIA) | ollama-amd (Radeon, Linux) | # extras (ComfyUI: photo editing, 3D, video — NVIDIA) | music (ACE-Step — NVIDIA) # docker compose pull && docker compose up -d update to the newest version # # Settings go in a file named .env next to this one, e.g. # PHOTOS_DIR=/home/me/Pictures the library: where the phones' uploads are saved # DRIVES_1=/media where USB drives show up (Mac: /Volumes, Windows: D:\) # DRIVES_2=/mnt another disk or folder (Windows: E:\) # OLLAMA_URL=http://ollama:11434 # The library can be on a USB drive or a NAS share the computer mounted, e.g. # PHOTOS_DIR=/media/me/MyDrive/Photos (Linux) /Volumes/MyDrive/Photos (Mac) D:\Photos (Windows) # Then open http://localhost:8000 and make the first account (it is the admin). name: photoai services: redis: image: redis/redis-stack-server:7.4.0-v3 restart: unless-stopped environment: REDIS_ARGS: "--appendonly yes --save 300 10" volumes: - redis:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 20 app: image: ${PHOTOAI_IMAGE:-myphonetools/photoai:latest} restart: unless-stopped ports: - "${PORT:-8000}:8000" # HTTPS for direct connections from the internet (the server asks the router to pass a port on to it) - "${DIRECT_PORT:-8443}:8443" volumes: # Your photos and videos; what the phones upload is saved here too (iPhone/YYYY/MM) - ${PHOTOS_DIR:-./photos}:/media # Thumbnails, faces, 3D models, AI videos, and the trash - ${DATA_DIR:-./photoai-data}:/data # The computer's drives (USB drives, other disks, NAS shares the computer mounted): seen by # the server as /storage/drives1 and /storage/drives2 — pick photo folders on them in the app # (Settings → Storage). rslave (Linux): a USB drive plugged in later shows up too. - type: bind source: ${DRIVES_1:-./drives} target: /storage/drives1 bind: {create_host_path: true, propagation: "${DRIVES_PROPAGATION:-rprivate}"} - type: bind source: ${DRIVES_2:-./drives} target: /storage/drives2 bind: {create_host_path: true, propagation: "${DRIVES_PROPAGATION:-rprivate}"} # NAS shares (SMB / NFS) set up in the app are mounted by the server itself: it needs these cap_add: [SYS_ADMIN, DAC_READ_SEARCH] security_opt: ["apparmor:unconfined"] environment: REDIS_URL: redis://redis:6379 AUTH_REQUIRED: "1" # the first visit makes the admin account # The AI (Ollama): on this computer by default; http://ollama:11434 with the "ollama" profile OLLAMA_URL: ${OLLAMA_URL:-http://host.docker.internal:11434} OLLAMA_MODEL: ${OLLAMA_MODEL:-qwen2.5vl:7b} EXPAND_MODEL: ${EXPAND_MODEL:-qwen3:1.7b} EMBED_MODEL: ${EMBED_MODEL:-nomic-embed-text} LIBRARY_OWNER: ${LIBRARY_OWNER:-admin} TRASH_DIR: /data/trash THUMB_DIR: /data/thumbs FACE_CROP_DIR: /data/faces MODEL3D_DIR: /data/models3d ANIM_DIR: /data/videos TZ: ${TZ:-UTC} # the extras on this computer (set by the installer): ComfyUI and ACE-Step EDIT_URL: ${EDIT_URL:-} MUSIC_URL: ${MUSIC_URL:-} SHARED_GPU: ${SHARED_GPU:-} DATA_DIR: /data DIRECT_PORT: "8443" DIRECT_HOST_PORT: ${DIRECT_PORT:-8443} LAN_IP: ${LAN_IP:-} # this computer and the router on the home network (the installer LAN_GATEWAY: ${LAN_GATEWAY:-} # writes them) — for opening the router port # 1: the AI and the extras share one graphics card OLLAMA_KEEP_ALIVE: ${OLLAMA_KEEP_ALIVE:--1} extra_hosts: - "host.docker.internal:host-gateway" # Linux: reach Ollama on this computer depends_on: redis: condition: service_healthy # Optional: Ollama in a container (docker compose --profile ollama up -d). # NVIDIA GPU on Linux/Windows: install the NVIDIA Container Toolkit and remove the # below. ollama: image: ollama/ollama:0.12.6 profiles: ["ollama"] restart: unless-stopped volumes: - ollama:/root/.ollama # deploy: # resources: # reservations: # devices: [{driver: nvidia, count: all, capabilities: [gpu]}] # Optional: Ollama on an AMD Radeon card (Linux, ROCm): COMPOSE_PROFILES=ollama-amd, OLLAMA_URL=http://ollama-amd:11434 ollama-amd: image: ollama/ollama:0.12.6-rocm profiles: ["ollama-amd"] restart: unless-stopped devices: ["/dev/kfd", "/dev/dri"] volumes: - ollama:/root/.ollama # Optional extras (NVIDIA card, 16–24 GB): built here by the installer from ./extras (setup.photo.myphonetools.com/extras) comfyui: # photo editing, "Make clear", 3D models, photo → video build: ./extras/comfyui image: photoai-comfyui:local profiles: ["extras"] restart: unless-stopped volumes: - comfyui-models:/opt/ComfyUI/models - comfyui-io:/opt/ComfyUI/output deploy: resources: reservations: devices: [{driver: nvidia, count: all, capabilities: [gpu]}] acestep: # music for album videos build: ./extras/acestep image: photoai-acestep:local profiles: ["music"] restart: unless-stopped volumes: - acestep-models:/app/checkpoints - acestep-cache:/root/.cache/huggingface deploy: resources: reservations: devices: [{driver: nvidia, count: all, capabilities: [gpu]}] volumes: redis: ollama: comfyui-models: comfyui-io: acestep-models: acestep-cache: