-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
120 lines (111 loc) · 3.59 KB
/
compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: immich
services:
server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:v1.124.2@sha256:b3fdb7fd96ac1d6cd40d3810dc54afa656b1097401a7c819e0c55aee68b39ee3
environment:
UPLOAD_LOCATION: ./library
IMMICH_CONFIG_FILE: /config/immich.json
DB_HOSTNAME: $DB_HOSTNAME
DB_DATABASE_NAME: $DB_DATABASE_NAME
DB_USERNAME: $DB_USERNAME
DB_PASSWORD: $DB_PASSWORD
volumes:
- ./library:/usr/src/app/upload
configs:
- source: timezone
target: /etc/localtime
- source: immich_config
target: /config/immich.json
depends_on:
database:
condition: service_healthy
redis:
condition: service_healthy
restart: always
machine-learning:
container_name: immich_machine-learning
image: ghcr.io/immich-app/immich-machine-learning:v1.124.2@sha256:397673b786ceb06d3fba848e2fc5ba8cd8a42351e9bd15eb439662da405a7918
volumes:
- model-cache:/cache
restart: always
database:
container_name: immich_database
image: tensorchord/pgvecto-rs:pg16-v0.3.0@sha256:9722631d44e76d46a8301859c46294f2c2c6a2f95e8706b55b4d654d6eaeafba
environment:
POSTGRES_HOST: $DB_HOSTNAME
POSTGRES_DB: $DB_DATABASE_NAME
POSTGRES_USER: $DB_USERNAME
POSTGRES_PASSWORD: $DB_PASSWORD
volumes:
- database:/var/lib/postgresql/data
- backup:/tmp/backup
healthcheck:
test: pg_isready -d '$DB_DATABASE_NAME' -U '$DB_USERNAME' || exit 1
labels:
docker-volume-backup.archive-pre: pg_dump -d '$DB_DATABASE_NAME' -U '$DB_USERNAME' -f /tmp/backup/immich.sql
restart: always
redis:
container_name: immich_redis
image: redis:7.2.5-alpine3.19@sha256:8f157725f8eee31e65a8d4765f1f986d76aedc1a0503345dfb63a2b1b5a441ee
healthcheck:
test: redis-cli ping || exit 1
restart: always
backup-database: &backup
container_name: immich_backup-database
image: offen/docker-volume-backup:v2.43.1@sha256:113d0aace06c83519a304e9b9c13fc65ebe2e52f5b027897886c8c0566a23d72
environment:
BACKUP_CRON_EXPRESSION: 0 5 * * *
BACKUP_FILENAME: immich_database_%Y%m%d.{{ .Extension }}
BACKUP_SKIP_BACKENDS_FROM_PRUNE: s3
AWS_S3_BUCKET_NAME: $R2_BUCKET_NAME
AWS_S3_PATH: $R2_PATH
BACKUP_ARCHIVE: /archive/database
BACKUP_RETENTION_DAYS: 7
GPG_PASSPHRASE: $DB_PASSWORD
env_file:
- path: ../.env
required: true
volumes:
- backup:/backup:ro
- $BACKUP_DIR/database:/archive/database
configs:
- source: docker-socket
target: /var/run/docker.sock
- source: timezone
target: /etc/localtime
depends_on:
database:
condition: service_healthy
restart: always
backup-library:
<<: *backup
container_name: immich_backup-library
environment:
BACKUP_CRON_EXPRESSION: 0 5 * * *
BACKUP_FILENAME: immich_library_%Y%m%d.{{ .Extension }}
BACKUP_SOURCES: /library
BACKUP_ARCHIVE: /archive/library
BACKUP_RETENTION_DAYS: 5
GPG_PASSPHRASE: $DB_PASSWORD
volumes:
- ./library:/library:ro
- $BACKUP_DIR/library:/archive/library
cloudflare-tunnel:
container_name: immich_cloudflare-tunnel
image: cloudflare/cloudflared:2025.1.0@sha256:3247f3ef49eda23244b8aa5583f82b7c3880b0d057e1172d0e818f5e678d9f27
command: tunnel --no-autoupdate run
environment:
TUNNEL_TOKEN: $TUNNEL_TOKEN
restart: always
volumes:
model-cache:
database:
backup:
configs:
docker-socket:
file: /var/run/docker.sock
timezone:
file: /etc/localtime
immich_config:
file: ./config/immich.json