forked from diffgram/diffgram
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
167 lines (165 loc) · 4.27 KB
/
docker-compose.yaml
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
version: "3.9"
services:
dispatcher:
image: diffgram/local_dispatcher:${DIFFGRAM_VERSION_TAG}
ports:
- "0.0.0.0:8085:8085"
expose: [8085]
depends_on:
- frontend
- default
- walrus
environment:
DOCKER_CONTEXT: True
DOCKER_COMPOSE_CONTEXT: True
frontend:
image: diffgram/frontend:${DIFFGRAM_VERSION_TAG}
ports:
- "0.0.0.0:8081:80"
expose: [80]
depends_on:
- default
eventhandlers:
image: diffgram/eventhandlers:${DIFFGRAM_VERSION_TAG}
ports:
- "0.0.0.0:8086:8086"
expose: [8086]
depends_on:
db:
condition: service_healthy
default:
condition: service_started
rabbitmq:
condition: service_healthy
volumes:
- ${GCP_SERVICE_ACCOUNT_FILE_PATH}:/gcp/gcp-service-account.json
env_file:
- .env
environment:
PYTHONPATH: "/app/"
DIFFGRAM_SERVICE_NAME: eventhandlers
DOCKER_COMPOSE_CONTEXT: True
entrypoint: ["python3", "-u", "/app/main.py"]
walrus:
image: diffgram/walrus:${DIFFGRAM_VERSION_TAG}
ports:
- "0.0.0.0:8082:8082"
expose: [8082]
depends_on:
db:
condition: service_healthy
default:
condition: service_started
rabbitmq:
condition: service_healthy
volumes:
- ${GCP_SERVICE_ACCOUNT_FILE_PATH}:/gcp/gcp-service-account.json
env_file:
- .env
environment:
PYTHONPATH: "/app/"
DIFFGRAM_SERVICE_NAME: walrus
DOCKER_COMPOSE_CONTEXT: True
entrypoint: ["python3", "-u", "/app/main.py"]
default:
image: diffgram/default:${DIFFGRAM_VERSION_TAG}
healthcheck:
test: curl --fail http://default:8080/api/status || exit 1
interval: 30s
timeout: 30s
retries: 5
start_period: 80s
ports:
- "0.0.0.0:8080:8080"
expose: [8080]
depends_on:
db:
condition: service_healthy
rabbitmq:
condition: service_healthy
db_migration:
condition: service_completed_successfully
volumes:
- ${GCP_SERVICE_ACCOUNT_FILE_PATH}:/gcp/gcp-service-account.json
env_file:
- .env
environment:
PYTHONPATH: "/app/"
DIFFGRAM_SERVICE_NAME: default
DOCKER_COMPOSE_CONTEXT: True
command: ["python3", "-u", "/app/main.py"]
db_migration:
image: diffgram/default:${DIFFGRAM_VERSION_TAG}
env_file:
- .env
environment:
PYTHONPATH: "/app/"
command: ["/app/db-init.sh", "${DATABASE_HOST}"]
depends_on:
db:
condition: service_healthy
rabbitmq:
condition: service_healthy
db:
image: ${POSTGRES_IMAGE}
hostname: db
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready", "-d", "db_prod" ]
interval: 30s
timeout: 60s
retries: 5
start_period: 80s
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRES_DB=diffgram
volumes:
# Default INTERNAL_POSTGRES_DIR=/var/lib/postgresql/data:Z
- ${POSTGRES_DATA_DIR:-./postgres-data}:${INTERNAL_POSTGRES_DIR:-/var/lib/postgresql/data}
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:3.10-rc-management-alpine
env_file:
- .env
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 30s
timeout: 30s
retries: 3
expose: [5672, 15672]
ports:
- 5672:5672
- 15672:15672
minio:
image: minio/minio
ports:
- "9000:9000"
- "9001:9001"
expose: [9000, 9001]
volumes:
- ./test/.minio/data:/export
- ./test/.minio/config:/root/.minio
environment:
- "MINIO_ROOT_USER=${DIFFGRAM_MINIO_ACCESS_KEY_ID}"
- "MINIO_ROOT_PASSWORD=${DIFFGRAM_MINIO_ACCESS_KEY_SECRET}"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/ready"]
interval: 30s
timeout: 20s
retries: 5
command: server /export --console-address :9001
createbuckets:
image: minio/mc
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add myminio http://minio:9000 ${DIFFGRAM_MINIO_ACCESS_KEY_ID} ${DIFFGRAM_MINIO_ACCESS_KEY_SECRET};
/usr/bin/mc mb myminio/${DIFFGRAM_S3_BUCKET_NAME};
/usr/bin/mc policy set policy myminio/${DIFFGRAM_S3_BUCKET_NAME} ;
exit 0;
"
volumes:
static: {}