112 lines
3.1 KiB
YAML
112 lines
3.1 KiB
YAML
# /opt/stacks/immich/docker-compose.yml
|
|
# Documentació oficial: https://docs.immich.app/install/docker-compose/
|
|
|
|
services:
|
|
|
|
# ── Immich Server ─────────────────────────
|
|
immich-server:
|
|
container_name: immich-server
|
|
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
|
|
restart: unless-stopped
|
|
environment:
|
|
TZ: ${TZ}
|
|
DB_URL: "postgresql://${DB_USERNAME}:${DB_PASSWORD}@immich-db:5432/${DB_DATABASE_NAME}"
|
|
REDIS_HOSTNAME: immich-redis
|
|
IMMICH_ENV: production
|
|
UPLOAD_LOCATION: ${UPLOAD_LOCATION}
|
|
volumes:
|
|
- ${UPLOAD_LOCATION}:/usr/src/app/upload
|
|
- /etc/localtime:/etc/localtime:ro
|
|
ports:
|
|
- "127.0.0.1:2283:2283" # Web UI → via Nginx Proxy Manager
|
|
depends_on:
|
|
immich-db:
|
|
condition: service_healthy
|
|
immich-redis:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:2283/api/server/ping"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 60s
|
|
networks:
|
|
- immich_net
|
|
- shared_net
|
|
|
|
|
|
# ── Machine Learning ──────────────────────
|
|
immich-machine-learning:
|
|
container_name: immich-machine-learning
|
|
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
|
|
restart: unless-stopped
|
|
environment:
|
|
TZ: ${TZ}
|
|
IMMICH_ENV: production
|
|
volumes:
|
|
- model-cache:/cache
|
|
healthcheck:
|
|
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:3003/ping')"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 120s # El model triga a carregar-se
|
|
networks:
|
|
- immich_net
|
|
|
|
|
|
# ── Redis ─────────────────────────────────
|
|
immich-redis:
|
|
container_name: immich-redis
|
|
image: redis:7-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
TZ: ${TZ}
|
|
volumes:
|
|
- redis-data:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 10s
|
|
networks:
|
|
- immich_net
|
|
|
|
|
|
# ── PostgreSQL + VectorChord ───────────────
|
|
# Imatge oficial d'Immich — substitueix tensorchord/pgvecto-rs (obsoleta)
|
|
immich-db:
|
|
container_name: immich-db
|
|
image: ghcr.io/immich-app/postgres:17-vectorchord
|
|
restart: unless-stopped
|
|
environment:
|
|
TZ: ${TZ}
|
|
POSTGRES_DB: ${DB_DATABASE_NAME}
|
|
POSTGRES_USER: ${DB_USERNAME}
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
|
POSTGRES_INITDB_ARGS: "--data-checksums"
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data # Volum named — mai network share
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME} -d ${DB_DATABASE_NAME}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
networks:
|
|
- immich_net
|
|
|
|
|
|
volumes:
|
|
pgdata:
|
|
model-cache:
|
|
redis-data:
|
|
|
|
|
|
networks:
|
|
immich_net:
|
|
driver: bridge
|
|
shared_net:
|
|
external: true
|
|
name: shared_net |