platform-codebase/features/image-assistant/docker-compose.yml
2026-02-01 18:36:39 -08:00

113 lines
3.6 KiB
YAML

# =============================================================================
# IMAGE ASSISTANT: Development Environment
# =============================================================================
#
# Complete development stack for image-assistant feature.
# Uses MinIO for object storage and Redis for job queues.
#
# Usage:
# docker-compose up -d # Start all services
# docker-compose logs -f # Follow logs
# docker-compose down # Stop all services
#
# Services:
# - postgres: PostgreSQL database for metadata
# - redis: Cache and thumbnail processing queue
# - minio: S3-compatible object storage for photos
#
# =============================================================================
services:
# =============================================================================
# DATABASE: PostgreSQL for photo metadata
# =============================================================================
image-assistant-postgres:
image: postgres:16-alpine
container_name: lilith-image-assistant-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-imageassist_dev_password}
POSTGRES_DB: ${POSTGRES_DB:-image_assistant}
ports:
- "${POSTGRES_PORT:-25448}:5432"
volumes:
- image-assistant-postgres-data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-image_assistant}']
interval: 10s
timeout: 5s
retries: 5
# =============================================================================
# CACHE & QUEUE: Redis for caching and thumbnail job queue
# =============================================================================
image-assistant-redis:
image: redis:7.4-alpine
container_name: lilith-image-assistant-redis
restart: unless-stopped
ports:
- "${REDIS_PORT:-26392}:6379"
command:
- redis-server
- --appendonly
- "yes"
- --appendfsync
- "everysec"
- --maxmemory
- "${REDIS_MAX_MEMORY:-512mb}"
- --maxmemory-policy
- "allkeys-lru"
volumes:
- image-assistant-redis-data:/data
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 3s
retries: 5
# =============================================================================
# OBJECT STORAGE: MinIO for photo files
# =============================================================================
image-assistant-minio:
image: minio/minio:latest
container_name: lilith-image-assistant-minio
restart: unless-stopped
environment:
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-imageassist_access}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:-imageassist_secret_dev_key}
ports:
- "${MINIO_PORT:-9012}:9000"
- "${MINIO_CONSOLE_PORT:-9013}:9001"
command: server /data --console-address ":9001"
volumes:
- image-assistant-minio-data:/data
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 30s
timeout: 10s
retries: 3
# =============================================================================
# NAMED VOLUMES
# =============================================================================
volumes:
image-assistant-postgres-data:
name: lilith-${LILITH_ENV:-dev}-image-assistant-postgres-data
image-assistant-redis-data:
name: lilith-${LILITH_ENV:-dev}-image-assistant-redis-data
image-assistant-minio-data:
name: lilith-${LILITH_ENV:-dev}-image-assistant-minio-data