Skip to content

Instantly share code, notes, and snippets.

@starbuck93
Created January 9, 2025 23:52
Show Gist options
  • Save starbuck93/5ce522b007f67267869afbf13d071f40 to your computer and use it in GitHub Desktop.
Save starbuck93/5ce522b007f67267869afbf13d071f40 to your computer and use it in GitHub Desktop.
my personal immich docker compose
version: "3.8"
services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
extends:
file: hwaccel.yml
service: hwaccel
volumes:
- ${HDD_LOCATION}/upload:/usr/src/app/upload/upload
- ${HDD_LOCATION}/backups:/usr/src/app/upload/backups
- ${HDD_LOCATION}/library:/usr/src/app/upload/library
- ${SSD_LOCATION}/thumbs:/usr/src/app/upload/thumbs
- ${SSD_LOCATION}/encoded-video:/usr/src/app/upload/encoded-video
- ${SSD_LOCATION}/profile:/usr/src/app/upload/profile
- /etc/localtime:/etc/localtime:ro
env_file:
- .env
ports:
- 2283:2283
depends_on:
- redis
- database
restart: always
networks:
- immich_internal
- cloudflared
immich-machine-learning:
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
extends:
file: hwaccel.yml
service: hwaccel
volumes:
- model-cache:/cache
env_file:
- .env
restart: always
networks:
- immich_internal
redis:
container_name: immich_redis
image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
healthcheck:
test: redis-cli ping || exit 1
restart: always
networks:
- immich_internal
database:
container_name: immich_postgres
image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: '--data-checksums'
volumes:
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
healthcheck:
test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
interval: 5m
start_period: 5m
command: ["postgres", "-c" ,"shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
restart: always
networks:
- immich_internal
volumes:
model-cache:
networks:
cloudflared:
external: true
name: cloudflared
immich_internal:
name: immich_internal
###################################################################################
# Database
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE_NAME=immich
# Optional Database settings:
# DB_PORT=5432
###################################################################################
# Redis
###################################################################################
REDIS_HOSTNAME=immich_redis
# Optional Redis settings:
# REDIS_PORT=6379
# REDIS_DBINDEX=0
# REDIS_PASSWORD=
# REDIS_SOCKET=
###################################################################################
# Upload File Location
#
# This is the location where uploaded files are stored.
###################################################################################
HDD_LOCATION=/mnt/user/immich
SSD_LOCATION=/mnt/user/immich-gen
DB_DATA_LOCATION=/mnt/user/appdata/immich/postgres
###################################################################################
# Log message level - [simple|verbose]
###################################################################################
LOG_LEVEL=log
###################################################################################
# JWT SECRET
#
# This JWT_SECRET is used to sign the authentication keys for user login
# You should set it to a long randomly generated value
# You can use this command to generate one: openssl rand -base64 128
###################################################################################
JWT_SECRET=
###################################################################################
# Reverse Geocoding
#
# Reverse geocoding is done locally which has a small impact on memory usage
# This memory usage can be altered by changing the REVERSE_GEOCODING_PRECISION variable
# This ranges from 0-3 with 3 being the most precise
# 3 - Cities > 500 population: ~200MB RAM
# 2 - Cities > 1000 population: ~150MB RAM
# 1 - Cities > 5000 population: ~80MB RAM
# 0 - Cities > 15000 population: ~40MB RAM
####################################################################################
DISABLE_REVERSE_GEOCODING=false
REVERSE_GEOCODING_PRECISION=3
####################################################################################
# WEB - Optional
#
# Custom message on the login page, should be written in HTML form.
# For example:
# PUBLIC_LOGIN_PAGE_MESSAGE="This is a demo instance of Immich.<br><br>Email: <i>[email protected]</i><br>Password: <i>demo</i>"
####################################################################################
PUBLIC_LOGIN_PAGE_MESSAGE=
####################################################################################
# Alternative Service Addresses - Optional
#
# This is an advanced feature for users who may be running their immich services on different hosts.
# It will not change which address or port that services bind to within their containers, but it will change where other services look for their peers.
# Note: immich-microservices is bound to 3002, but no references are made
####################################################################################
# IMMICH_SERVER_URL=
# IMMICH_WEB_URL=
# IMMICH_MACHINE_LEARNING_URL=
####################################################################################
# OAuth Setting - Optional
#
# These setting will enable OAuth login for your instance of Immich
# Folow the instructions in the page https://immich.app/docs/usage/oauth to set up your OAuth provider
####################################################################################
# OAUTH_ENABLED=false
# OAUTH_ISSUER_URL=
# OAUTH_CLIENT_ID=
# OAUTH_CLIENT_SECRET=
# OAUTH_BUTTON_TEXT=Login with OAuth
# OAUTH_AUTO_REGISTER=true
# OAUTH_SCOPE="openid profile email"
TYPESENSE_API_KEY=
#Immich Power Tools
IMMICH_URL= # This should be the immich url which is accessible in your browser
IMMICH_API_KEY= # your_immich_api_key
DATABASE_URL=postgresql://postgres:postgres@immich_postgres:5432/immich
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment