Immich – Production Docker Compose (Johannes)

Googled777 avatar   
Googled777
Note: This compose file is designed for Johannes as a production Immich node behind HAProxy. No ports are exposed directly; HAProxy terminates TLS and forwards traffic to the Immich server container. ..


Immich – Production Docker Compose (Johannes)

Immich – Production Docker Compose (Johannes)

Johannes RTX 4070 64 GB RAM HAProxy Backend

Note: This compose file is designed for Johannes as a production Immich node behind HAProxy. No ports are exposed directly; HAProxy terminates TLS and forwards traffic to the Immich server container. GPU is reserved for the immich-machine-learning container only.

Environment expectations

  • .env file present next to docker-compose.yml
  • Contains at least:
    • DB_USERNAME
    • DB_PASSWORD
    • DB_DATABASE_NAME
    • IMMICH_VERSION (e.g. v1.105.0 or release)
  • HAProxy points to immich-server on port 2283 (internal only)

docker-compose.yml

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    depends_on:
      - redis
      - database
    env_file:
      - .env
    volumes:
      # Main Immich upload storage (bind this to your real storage on Johannes if desired)
      - immich_upload:/usr/src/app/upload
    # No ports exposed here; HAProxy will connect to this container on the internal Docker network.
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-cuda
    env_file:
      - .env
    volumes:
      # Cache for ML models (keeps downloads and optimizations between restarts)
      - model-cache:/cache
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    restart: always

  redis:
    container_name: immich_redis
    image: redis:7
    restart: always

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.2.0
    environment:
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always

volumes:
  immich_upload:
  pgdata:
  model-cache:

Johannes-specific notes

  • Ingress: HAProxy backend should target immich_server:2283 on the Docker network.
  • Storage: For production, you can replace:
    immich_upload:/usr/src/app/upload
    with a bind mount, e.g.:
    /srv/immich/upload:/usr/src/app/upload
  • GPU: Only the ML container needs GPU; server stays CPU-only for stability and clarity.
  • Backups: Snapshot or back up pgdata and immich_upload regularly.

Optional: test version for Signal Raider / MSI

If you want a quick test variant for Signal Raider or MSI with direct port exposure, you can temporarily add:

    ports:
      - "2283:2283"

under immich-server, then remove it again for Johannes.

0 注释

没有找到评论