Be Your Own Cloud code · PART 3 — THE STACK

Chapter 13 Immich: Photos and Video, Off the Cloud

2 blocks · pp. 59–60 in the paperback

Going further than the chapter: Immich: Going Deeper , Google Photos to Immich, Dates and Albums Intact

More Moving Parts Than You've Seen So Far

# p. 59

File /opt/stacks/immich/docker-compose.yml
services:
  immich-server:
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION}
    container_name: immich_server
    restart: unless-stopped
    volumes:
      - ${UPLOAD_LOCATION}:/data   # your photo library -- set in .env
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
    ports:
      - '2283:2283'
  immich-machine-learning:
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION}
    container_name: immich_machine_learning
    restart: unless-stopped
    volumes:
      - model-cache:/cache
    env_file:
      - .env
  redis:
    image: docker.io/valkey/valkey:9
    container_name: immich_redis
    restart: unless-stopped
  database:
    image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0
    container_name: immich_postgres
    restart: unless-stopped
    environment:
      - POSTGRES_PASSWORD=${DB_PASSWORD}
      - POSTGRES_USER=${DB_USERNAME}
      - POSTGRES_DB=${DB_DATABASE_NAME}
      - POSTGRES_INITDB_ARGS=--data-checksums
    volumes:
      - ./pgdata:/var/lib/postgresql/data
    shm_size: 128mb
volumes:
  model-cache:

# p. 60

File /opt/stacks/immich/.env
# /opt/stacks/immich/.env
IMMICH_VERSION=v3.2.4
UPLOAD_LOCATION=/mnt/media/photos   # your photo library (Chapter 7)
DB_PASSWORD=a_long_random_password   # letters and numbers only
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduced exactly from Be Your Own Cloud, Chapter 13. The book explains what each line does and what to do when it doesn't work. About the book

Something here not working as the book describes? Tell the author.