forked from jykuo-love-shiritori/twp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
77 lines (72 loc) · 1.86 KB
/
docker-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
version: "3.8"
services:
twp:
build: .
env_file:
- .env
ports:
- "${TWP_PORT}:${TWP_PORT}"
restart: unless-stopped
depends_on:
- postgres
- minio
postgres:
image: postgres:16
env_file:
- .env
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
volumes:
- postgres-data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"
]
interval: 10s
timeout: 5s
retries: 5
migrate:
image: migrate/migrate
depends_on:
- postgres
env_file:
- .env
volumes:
- ./db/migrations:/migrations
command: -path=/migrations -database=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:${POSTGRES_PORT}/${POSTGRES_DB}?sslmode=disable up
minio:
image: quay.io/minio/minio:RELEASE.2023-12-02T10-51-33Z
env_file:
- .env
ports:
- "${MINIO_API_PORT}:${MINIO_API_PORT}"
- "${MINIO_CONSOLE_PORT}:${MINIO_CONSOLE_PORT}"
volumes:
- minio-data:/data
command: server /data --console-address ":${MINIO_CONSOLE_PORT}"
restart: unless-stopped
healthcheck:
test:
[
"CMD-SHELL",
"curl -f http://localhost:${MINIO_CONSOLE_PORT}/minio/health/live || exit 1"
]
interval: 10s
timeout: 5s
retries: 5
minio-setup:
image: minio/mc
depends_on:
- minio
env_file:
- .env
entrypoint: >
/bin/sh -c "/usr/bin/mc alias set myminio http://minio:${MINIO_API_PORT} ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD};
/usr/bin/mc admin user svcacct add myminio ${MINIO_ROOT_USER} --access-key ${MINIO_ACCESS_KEY} --secret-key ${MINIO_SECRET_KEY};
/usr/bin/mc mb myminio/${MINIO_BUCKET_NAME};"
volumes:
postgres-data:
minio-data: