ReactionShot

Immich Config

Jan 26th, 2025
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.40 KB | None | 0 0
  1. The compose script is at the very bottom and the environment variables are just below. Let me know if you have any questions. All of my containers are set to ephemeral=false and I add a tag of container to keep track of them. You can modify both of these settings in the immich-ts environment variables.
  2.  
  3.  
  4. docker env variables:
  5. DB_DATA_LOCATION=./postgres
  6. DB_DATABASE_NAME=immich
  7. DB_USERNAME=(any username works)
  8. DB_PASSWORD=(generate your password)
  9. TS_AUTHKEY=(put your tailscale auth key here)
  10. PWD=(your immich directory on your server, e.g. /opt/portainer/config/immich)
  11.  
  12.  
  13. My tailscale serve file is located at: /opt/portainer/config/immich/immich.json
  14. Tailscale serve json below for reference, true/false for enabling funnel. Note: You will have to manually approve the funnel in your tailscale console if you set this to true.
  15.  
  16. {
  17. "TCP": {
  18. "443": {
  19. "HTTPS": true
  20. }
  21. },
  22. "Web": {
  23. "immich.(your tailscale magic dns).ts.net:443": {
  24. "Handlers": {
  25. "/": {
  26. "Proxy": "http://127.0.0.1:2283"
  27. }
  28. }
  29. }
  30. },
  31. "AllowFunnel": {
  32. "immich.(your tailscale magic dns).ts.net:443": true
  33. }
  34. }
  35.  
  36.  
  37.  
  38. services:
  39. immich-ts:
  40. image: tailscale/tailscale:latest
  41. container_name: immich-ts
  42. cap_add:
  43. - net_admin
  44. - sys_module
  45. volumes:
  46. - ${PWD}/state:/var/lib/tailscale
  47. - ${PWD}:/config
  48. - /dev/net/tun:/dev/net/tun
  49. environment:
  50. - TS_AUTHKEY=${TS_AUTHKEY}?ephemeral=false
  51. - TS_EXTRA_ARGS=--advertise-tags=tag:container --reset
  52. - TS_STATE_DIR=/var/lib/tailscale
  53. - TS_SERVE_CONFIG=/config/immich.json
  54. - TS_USERSPACE=false
  55. hostname: immich
  56. restart: unless-stopped
  57. env_file:
  58. - stack.env
  59. immich-server:
  60. container_name: immich_server
  61. image: ghcr.io/immich-app/immich-server:release
  62. network_mode: service:immich-ts
  63. volumes:
  64. # Edit the following line to be your Immich directory on your server or NAS. e.g. /nfs/Immich
  65. - $INSERT NAS/FILESYSTEM MOUNT$:/usr/src/app/upload
  66. - /etc/localtime:/etc/localtime:ro
  67. env_file:
  68. - stack.env
  69. depends_on:
  70. - redis
  71. - database
  72. restart: unless-stopped
  73. immich-machine-learning:
  74. container_name: immich_machine_learning
  75. # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
  76. # Example tag: ${IMMICH_VERSION:-release}-cuda
  77. image: ghcr.io/immich-app/immich-machine-learning:release
  78. # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
  79. # file: hwaccel.ml.yml
  80. # service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
  81. volumes:
  82. - model-cache:/cache
  83. env_file:
  84. - stack.env
  85. restart: unless-stopped
  86. redis:
  87. container_name: immich_redis
  88. image: docker.io/redis:6.2-alpine@sha256:2d1463258f2764328496376f5d965f20c6a67f66ea2b06dc42af351f75248792
  89. restart: unless-stopped
  90. database:
  91. container_name: immich_postgres
  92. image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
  93. environment:
  94. POSTGRES_PASSWORD: ${DB_PASSWORD}
  95. POSTGRES_USER: ${DB_USERNAME}
  96. POSTGRES_DB: ${DB_DATABASE_NAME}
  97. POSTGRES_INITDB_ARGS: '--data-checksums'
  98. volumes:
  99. # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
  100. - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
  101. # healthcheck:
  102. # 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
  103. # interval: 5m
  104. # start_interval: 30s
  105. # start_period: 5m
  106. 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"]
  107. restart: unless-stopped
  108.  
  109. volumes:
  110. model-cache:
  111. immich-ts:
  112. driver: local
Advertisement
Add Comment
Please, Sign In to add comment