-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
242 lines (230 loc) · 5.62 KB
/
Copy pathdocker-compose.yml
File metadata and controls
242 lines (230 loc) · 5.62 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
services:
postgres:
image: postgres:16-alpine
container_name: soeji-postgres
environment:
POSTGRES_USER: soeji
POSTGRES_PASSWORD: soeji
POSTGRES_DB: soeji
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U soeji"]
interval: 10s
timeout: 5s
retries: 5
rustfs:
image: rustfs/rustfs:latest
container_name: soeji-rustfs
environment:
- RUSTFS_VOLUMES
- RUSTFS_ADDRESS
- RUSTFS_CONSOLE_ADDRESS
- RUSTFS_CONSOLE_ENABLE
- RUSTFS_ACCESS_KEY
- RUSTFS_SECRET_KEY
ports:
- "9000:9000"
- "9001:9001"
volumes:
- rustfs_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/health"]
interval: 5s
timeout: 3s
retries: 10
start_period: 40s
rustfs-setup:
image: minio/mc:latest
container_name: soeji-rustfs-setup
depends_on:
rustfs:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set myrustfs http://rustfs:9000 rustfsadmin rustfsadmin;
mc mb myrustfs/soeji-images --ignore-existing;
mc anonymous set public myrustfs/soeji-images;
exit 0;
"
converter:
build:
context: .
dockerfile: converter/Dockerfile
container_name: soeji-converter
ports:
- "8000:8000"
environment:
- CONVERTER_PORT
- S3_ENDPOINT
- S3_ACCESS_KEY
- S3_SECRET_KEY
- S3_REGION
- WEBP_DEFAULT_QUALITY
- MAX_DIMENSION
- RUST_LOG
depends_on:
rustfs:
condition: service_healthy
healthcheck:
test: ["CMD", "/soeji-converter", "-healthcheck"]
interval: 10s
timeout: 5s
retries: 3
restart: unless-stopped
cdn:
image: nginx:1.28
container_name: soeji-cdn
environment:
# Backend URL for auth_request
- BACKEND_URL
volumes:
- ./cdn/templates:/etc/nginx/templates:ro
- cdn_cache:/var/cache/nginx
ports:
- "9080:80"
depends_on:
converter:
condition: service_healthy
backend:
condition: service_started
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/health"]
interval: 10s
timeout: 5s
retries: 3
restart: unless-stopped
meilisearch:
image: getmeili/meilisearch:v1.11
container_name: soeji-meilisearch
environment:
MEILI_MASTER_KEY: masterKey
MEILI_ENV: development
ports:
- "7700:7700"
volumes:
- meilisearch_data:/meili_data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7700/health"]
interval: 10s
timeout: 5s
retries: 5
adminer:
image: adminer:latest
container_name: soeji-adminer
ports:
- "8081:8080"
depends_on:
postgres:
condition: service_healthy
frontend:
build:
context: .
dockerfile: frontend/Dockerfile
args:
COMMIT_HASH: ${COMMIT_HASH:-unknown}
container_name: soeji-frontend
ports:
- "8080:80"
depends_on:
- backend
restart: unless-stopped
migrate:
build:
context: .
dockerfile: backend/Dockerfile.migrate
container_name: soeji-migrate
environment:
DATABASE_URL: postgresql://soeji:soeji@postgres:5432/soeji
depends_on:
postgres:
condition: service_healthy
restart: "no"
backend:
build:
context: .
dockerfile: backend/Dockerfile
container_name: soeji-backend
environment:
- DATABASE_URL
- MEILISEARCH_HOST
- MEILISEARCH_API_KEY
- S3_ENDPOINT
- S3_PUBLIC_ENDPOINT
- S3_ACCESS_KEY
- S3_SECRET_KEY
- S3_BUCKET
- S3_REGION
- PORT=3000
# Authentication settings
- AUTH_ENABLED
- JWT_SECRET
- JWT_ACCESS_TOKEN_EXPIRES
- JWT_REFRESH_TOKEN_EXPIRES_DAYS
# Setup key for initial admin account creation (required for setup)
- SETUP_KEY
# Watcher API key for internal authentication
- WATCHER_API_KEY
depends_on:
postgres:
condition: service_healthy
meilisearch:
condition: service_healthy
rustfs-setup:
condition: service_completed_successfully
migrate:
condition: service_completed_successfully
restart: unless-stopped
watcher:
build:
context: .
dockerfile: watcher/Dockerfile
container_name: soeji-watcher
environment:
- BACKEND_URL=http://backend:3000
- WATCHER_API_KEY
- DELETE_AFTER_PROCESS=true
- WATCH_DIR=/data/images
volumes:
- watch_data:/data/images
depends_on:
backend:
condition: service_started
restart: unless-stopped
samba:
image: dperson/samba
container_name: soeji-samba
environment:
TZ: Asia/Tokyo
USERID: "1000"
GROUPID: "1000"
command: >
-u "soeji;soeji"
-s "images;/data/images;yes;no;no;soeji;soeji"
-g "server min protocol = SMB2"
-g "server max protocol = SMB3"
-g "client min protocol = SMB2"
-g "ea support = yes"
-g "vfs objects = fruit streams_xattr"
-g "fruit:metadata = stream"
-g "fruit:model = MacSamba"
-g "fruit:posix_rename = yes"
-g "fruit:veto_appledouble = no"
-g "fruit:wipe_intentionally_left_blank_rfork = yes"
-g "fruit:delete_empty_adfiles = yes"
ports:
- "137:137/udp"
- "138:138/udp"
- "139:139"
- "445:445"
volumes:
- watch_data:/data/images
restart: unless-stopped
volumes:
watch_data:
postgres_data:
rustfs_data:
meilisearch_data:
cdn_cache: