Skip to content

Instantly share code, notes, and snippets.

@magicstone1412
Created October 19, 2024 14:15
Show Gist options
  • Save magicstone1412/73e900aa9cbccc201e60dda6de1ff25a to your computer and use it in GitHub Desktop.
Save magicstone1412/73e900aa9cbccc201e60dda6de1ff25a to your computer and use it in GitHub Desktop.

Revisions

  1. magicstone1412 created this gist Oct 19, 2024.
    85 changes: 85 additions & 0 deletions immich.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,85 @@
    ---
    services:
    # Main Immich Server service configuration
    immich-server:
    container_name: immich-server
    image: ghcr.io/immich-app/immich-server:v1.118.2 # Image to be used
    ports: # Mapping ports from the host OS to the container
    - 2283:2283
    volumes: # Mounting directories for persistent data storage - CHANGE THIS
    - /srv/immich:/usr/src/app/upload

    environment: # Setting environment variables
    DB_HOSTNAME: immich-postgres
    DB_USERNAME: portainer
    DB_PASSWORD: portainer
    DB_DATABASE_NAME: immich
    DB_PORT: 5432
    REDIS_HOSTNAME: immich-redis
    IMMICH_MACHINE_LEARNING_URL: http://immich-machine-learning:3003
    depends_on: # Dependencies to ensure the order of service startup
    - redis
    - database
    restart: on-failure:5 # Policy to restart the container 5 times max if it stops
    networks:
    - immich-network

    # Configuration for Immich Machine Learning service
    immich-machine-learning:
    container_name: immich-machine-learning # Name of the running container
    image: ghcr.io/immich-app/immich-machine-learning:v1.118.2 # Image to be used
    volumes: # Mounting directories for persistent data storage
    - immich_cache:/cache
    environment: # Setting environment variables
    DB_HOSTNAME: immich-postgres
    DB_USERNAME: portainer
    DB_PASSWORD: portainer
    DB_DATABASE_NAME: immich
    DB_PORT: 5432
    REDIS_HOSTNAME: immich-redis
    restart: on-failure:5 # Policy to restart the container 5 times max if it stops
    networks:
    - immich-network

    # Configuration for Redis service
    redis:
    container_name: immich-redis # Name of the running container
    image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3 # Image to be used
    restart: on-failure:5 # Policy to restart the container 5 times max if it stops
    networks:
    - immich-network

    # Configuration for Database service
    database:
    container_name: immich-postgres # Name of the running container
    image: tensorchord/pgvecto-rs:pg14-v0.2.0 # Image to be used
    environment: # Setting environment variables
    POSTGRES_PASSWORD: portainer
    POSTGRES_USER: portainer
    POSTGRES_DB: immich
    PG_DATA: /var/lib/postgresql/data
    volumes: # Mounting directories for persistent data storage
    - immich_postgres:/var/lib/postgresql/data
    restart: on-failure:5 # Policy to restart the container 5 times max if it stops
    networks:
    - immich-network

    # Network definitions
    networks:
    # Define the network
    immich-network:
    # Use the bridge driver
    driver: bridge

    # Define named volumes for data persistence.
    volumes:
    # Define a named volume for Immich data.
    immich_cache:
    # Use the local storage driver.
    driver: local
    immich_upload:
    # Use the local storage driver.
    driver: local
    immich_postgres:
    # Use the local storage driver.
    driver: local