immich/variables.yml

148 lines
4.3 KiB
YAML
Raw Normal View History

2023-11-25 22:04:47 +01:00
---
immich:
2023-11-27 23:07:31 +01:00
# Name of this instance of immich
2023-11-25 22:04:47 +01:00
instance: immich
2023-11-27 23:07:31 +01:00
# Immich version
2023-11-29 21:38:09 +01:00
version: v1.89.0
2023-11-25 22:04:47 +01:00
2023-11-27 23:07:31 +01:00
# API server settings
2023-11-25 22:04:47 +01:00
server:
2023-11-27 23:07:31 +01:00
# Docker image to use
2023-11-25 22:04:47 +01:00
image: ghcr.io/immich-app/immich-server:[[ .immich.version ]]
2023-11-27 23:07:31 +01:00
# Additional env to set ni the container
2023-11-25 22:04:47 +01:00
env:
DB_URL: '{{ with secret "[[ .vault.prefix ]]database/creds/[[ .immich.instance ]]" }}postgres://{{ .Data.username }}:{{ urlquery .Data.password }}@localhost:5432/[[ .immich.instance ]]{{ end }}'
2023-11-27 23:07:31 +01:00
TYPESENSE_API_KEY: '{{ with secret "[[ .vault.prefix ]]kv/service/[[ .immich.instance ]]" }}{{ .Data.data.typesense_api_key }}{{ end }}'
2023-11-30 20:45:32 +01:00
NODE_OPTIONS: --max_old_space_size={{ env "NOMAD_MEMORY_LIMIT" | parseInt | divide 2 }}
2023-11-25 22:04:47 +01:00
2023-11-27 23:07:31 +01:00
# Resource allocation
2023-11-25 22:04:47 +01:00
resources:
2023-11-27 23:07:31 +01:00
cpu: 300
memory: 320
2023-11-25 22:04:47 +01:00
2023-11-27 23:07:31 +01:00
# Wait for services to be ready before starting
2023-11-25 22:04:47 +01:00
wait_for:
2023-11-27 23:07:31 +01:00
- service: master.postgres[[ .consul.suffix ]]
- service: '[[ .immich.instance ]]-ml[[ .consul.suffix ]]'
2023-11-25 22:04:47 +01:00
consul:
connect:
2023-11-27 23:07:31 +01:00
# Connect to some services through the mesh
2023-11-25 22:04:47 +01:00
upstreams:
2023-11-27 23:07:31 +01:00
- destination_name: '[[ .immich.instance ]]-ml[[ .consul.suffix ]]'
local_bind_port: 3003
2023-11-25 22:04:47 +01:00
- destination_name: postgres[[ .consul.suffix ]]
local_bind_port: 5432
2023-11-27 23:07:31 +01:00
# The URL where Immich will be exposed to users
public_url: https://immich.example.org
# Controls how Traefik will expose the service
2023-11-25 22:04:47 +01:00
traefik:
enabled: true
2023-11-27 23:07:31 +01:00
# Immich needs a specific CSP
csp:
default-src: "'self'"
img-src: "'self' data: blob:"
script-src: "'self' 'unsafe-inline' 'unsafe-eval'"
style-src: "'self' 'unsafe-inline'"
font-src: "'self' data:"
worker-src: "'self' blob:"
connect-src: "'self' https://maputnik.github.io https://*.cofractal.com https://fonts.openmaptiles.org"
# Override the list of base middlewares as we need to remove csp-relaxed and rate-limits
base_middlewares:
- security-headers@file
- hsts@file
- compression@file
middlewares: []
# Use distinct Traefik settings for /share. This can be used for example to restrict the main app to trusted IP but allow /share from anywhere
share:
traefik:
base_middlewares:
- security-headers@file
- hsts@file
- compression@file
middlewares: []
# The microservices do the bulk of media handling (thumbnails etc.)
2023-11-25 22:04:47 +01:00
microservices:
2023-11-27 23:07:31 +01:00
# Docker image to use
2023-11-25 22:04:47 +01:00
image: ghcr.io/immich-app/immich-server:[[ .immich.version ]]
2023-11-27 23:07:31 +01:00
# Env vars to set in the container
2023-11-25 22:04:47 +01:00
env:
DB_URL: '{{ with secret "[[ .vault.prefix ]]database/creds/[[ .immich.instance ]]" }}postgres://{{ .Data.username }}:{{ urlquery .Data.password }}@localhost:5432/[[ .immich.instance ]]{{ end }}'
2023-11-27 23:07:31 +01:00
TYPESENSE_API_KEY: '{{ with secret "[[ .vault.prefix ]]kv/service/[[ .immich.instance ]]" }}{{ .Data.data.typesense_api_key }}{{ end }}'
2023-11-30 20:45:32 +01:00
NODE_OPTIONS: --max_old_space_size={{ env "NOMAD_MEMORY_LIMIT" | parseInt | divide 2 }}
2023-11-25 22:04:47 +01:00
2023-11-27 23:07:31 +01:00
# Resource allocation
2023-11-25 22:04:47 +01:00
resources:
2023-11-27 23:07:31 +01:00
cpu: 500
2023-11-25 22:04:47 +01:00
memory: 768
2023-11-27 23:07:31 +01:00
# The machine learning
2023-11-25 22:04:47 +01:00
machine_learning:
2023-11-27 23:07:31 +01:00
# Machine learning is optional, and can be disabled
enabled: true
# The Docker image to use
2023-11-25 22:04:47 +01:00
image: ghcr.io/immich-app/immich-machine-learning:[[ .immich.version ]]
2023-11-27 23:07:31 +01:00
# Environment var to set in the container
2023-11-25 22:04:47 +01:00
env: {}
2023-11-27 23:07:31 +01:00
# Resource allocation
2023-11-25 22:04:47 +01:00
resources:
2023-11-27 23:07:31 +01:00
cpu: 1024
memory: 1536
2023-11-25 22:04:47 +01:00
2023-11-27 23:07:31 +01:00
# Typesense is a database for fast search result
typesense:
2023-11-25 22:04:47 +01:00
2023-11-27 23:07:31 +01:00
# Typesense is also an optional component and can be disabled
enabled: true
2023-11-25 22:04:47 +01:00
2023-11-27 23:07:31 +01:00
# DOcker image to use
image: typesense/typesense:0.25.1
2023-11-25 22:04:47 +01:00
2023-11-27 23:07:31 +01:00
# Environment var to set in the container
env:
TYPESENSE_API_KEY: '{{ with secret "[[ .vault.prefix ]]kv/service/[[ .immich.instance ]]" }}{{ .Data.data.typesense_api_key }}{{ end }}'
2023-11-25 22:04:47 +01:00
2023-11-27 23:07:31 +01:00
# Resource allocation
2023-11-25 22:04:47 +01:00
resources:
cpu: 100
2023-11-30 20:45:32 +01:00
memory: 512
memory_max: 768
2023-11-25 22:04:47 +01:00
2023-11-30 20:45:32 +01:00
# Redis task will use a common template
# We just set custom resources allocation
redis:
resources:
cpu: 20
memory: 64
# Volumes used for data persistance
2023-11-25 22:04:47 +01:00
volumes:
data:
type: csi
source: '[[ .immich.instance ]]-data'
ml:
type: csi
source: '[[ .immich.instance ]]-ml'
typesense:
type: csi
source: '[[ .immich.instance ]]-typesense'