homeserver/immich/docker-compose.yml
2026-08-02 11:13:42 +02:00

96 lines
No EOL
2.6 KiB
YAML

services:
immich-server:
image: ghcr.io/immich-app/immich-server:release
container_name: ${CONTAINER_NAME:-immich-server}
restart: ${RESTART_POLICY}
volumes:
- type: bind
source: ${UPLOAD_LOCATION}
target: /usr/src/app/upload
bind:
create_host_path: true
- /etc/localtime:/etc/localtime:ro
environment:
- DB_HOSTNAME=immich-db
- DB_USERNAME=${DB_USERNAME:-immich}
- DB_PASSWORD=${DB_PASSWORD}
- DB_DATABASE_NAME=${DB_DATABASE_NAME:-immich}
- REDIS_HOSTNAME=immich-redis
networks:
- traefik
- immich-internal
labels:
- "traefik.enable=true"
- "traefik.http.routers.${ROUTER_NAME}.entrypoints=websecure"
- "traefik.http.routers.${ROUTER_NAME}.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)"
- "traefik.http.routers.${ROUTER_NAME}.tls=true"
- "traefik.http.routers.${ROUTER_NAME}.tls.certresolver=${CERTIFICATE_RESOLVER}"
- "traefik.http.services.${ROUTER_NAME}.loadbalancer.server.port=2283"
- "traefik.docker.network=${TRAEFIK_NETWORK}"
depends_on:
- immich-redis
- immich-db
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
immich-machine-learning:
image: ghcr.io/immich-app/immich-machine-learning:release
container_name: ${ML_CONTAINER_NAME:-immich-machine-learning}
restart: ${RESTART_POLICY}
volumes:
- type: bind
source: ${MODEL_CACHE_LOCATION}
target: /cache
bind:
create_host_path: true
networks:
- immich-internal
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
immich-redis:
image: valkey/valkey:8-alpine
container_name: ${REDIS_CONTAINER_NAME:-immich-redis}
restart: ${RESTART_POLICY}
networks:
- immich-internal
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
immich-db:
image: pgvector/pgvector:pg16
container_name: ${DB_CONTAINER_NAME:-immich-db}
restart: ${RESTART_POLICY}
environment:
- POSTGRES_USER=${DB_USERNAME:-immich}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_DATABASE_NAME:-immich}
- POSTGRES_INITDB_ARGS=--data-checksums
volumes:
- type: bind
source: ${DB_DATA_PATH}
target: /var/lib/postgresql/data
bind:
create_host_path: true
networks:
- immich-internal
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
traefik:
external: true
immich-internal:
internal: true