Files
homelab-docker-stacks/immich/compose.yaml
T
lingkai5wu 6f18aa9c06 feat: add nginx reverse proxy stack
Add Nginx and acme.sh for centralized HTTPS termination and certificate management.

Move Gitea, Immich, and OpenList to the shared proxy network and remove their direct host port exposure.
2026-08-16 11:58:58 +08:00

92 lines
2.3 KiB
YAML

name: immich
services:
immich-server:
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
container_name: immich-server
depends_on:
- database
- redis
volumes:
- ${UPLOAD_LOCATION}:/data
- /etc/localtime:/etc/localtime:ro
# External librariey
- type: bind
source: /mnt/toshiba/media_library
target: /external/toshiba
bind:
create_host_path: false
env_file:
- .env
networks:
- default
- proxy
restart: unless-stopped
healthcheck:
disable: false
deploy:
resources:
limits:
cpus: "3.0"
memory: 4G
reservations:
cpus: "0.5"
memory: 512M
devices:
- /dev/dri:/dev/dri
# immich-machine-learning:
# container_name: immich-machine-learning
# image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
# volumes:
# - /srv/data/immich/model-cache:/cache
# env_file:
# - .env
# restart: unless-stopped
# healthcheck:
# disable: false
# deploy:
# resources:
# limits:
# cpus: "2.0"
# memory: 4G
database:
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23
container_name: immich-postgres
volumes:
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: --data-checksums
ports:
- "127.0.0.1:5432:5432"
restart: unless-stopped
healthcheck:
disable: false
deploy:
resources:
limits:
cpus: "1.0"
memory: 1G
reservations:
cpus: "0.2"
memory: 128M
shm_size: 128mb
redis:
image: docker.io/valkey/valkey:9@sha256:8e8d64b405ce18f41b8e5ee20aa4687a8ed0022d1298f2ce31cdcf3a76e09411
container_name: immich-redis
restart: unless-stopped
healthcheck:
test: redis-cli ping || exit 1
deploy:
resources:
limits:
cpus: "0.5"
memory: 512M
reservations:
cpus: "0.1"
memory: 64M
networks:
proxy:
external: true