forked from shuttle-hq/shuttle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
201 lines (201 loc) · 5.07 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
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
version: "3.7"
volumes:
auth-vol:
gateway-vol:
postgres-vol:
panamax-crates-vol:
panamax-io-index-vol:
networks:
user-net:
attachable: true
ipam:
driver: default
config:
- subnet: 10.99.0.0/16
services:
auth:
image: "${CONTAINER_REGISTRY}/auth:${BACKEND_TAG}"
ports:
- 8008:8000
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
update_config:
order: start-first
failure_action: rollback
delay: 10s
rollback_config:
parallelism: 0
order: stop-first
placement:
constraints:
- node.hostname==controller
networks:
user-net:
volumes:
- auth-vol:/var/lib/shuttle-auth
environment:
- RUST_LOG=${RUST_LOG}
command:
- "--state=/var/lib/shuttle-auth"
- "start"
- "--address=0.0.0.0:8000"
gateway:
image: "${CONTAINER_REGISTRY}/gateway:${BACKEND_TAG}"
depends_on:
- provisioner
- auth
ports:
- 7999:7999
- 8000:8000
- 8001:8001
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
update_config:
order: start-first
failure_action: rollback
delay: 10s
rollback_config:
parallelism: 0
order: stop-first
placement:
constraints:
- node.hostname==controller
networks:
user-net:
volumes:
- gateway-vol:/var/lib/shuttle
# This image needs to run highly privileged in order to
# orchestrate user runtimes safely
- ${DOCKER_SOCK}:/var/run/docker.sock
environment:
- RUST_LOG=${RUST_LOG}
command:
- "--state=/var/lib/shuttle"
- "start"
- "--control=0.0.0.0:8001"
- "--user=0.0.0.0:8000"
- "--bouncer=0.0.0.0:7999"
- "--image=${CONTAINER_REGISTRY}/deployer:${DEPLOYER_TAG}"
- "--prefix=shuttle_"
- "--network-name=${STACK}_user-net"
- "--docker-host=/var/run/docker.sock"
- "--auth-uri=http://auth:8000"
- "--provisioner-host=provisioner"
- "--proxy-fqdn=${APPS_FQDN}"
- "--use-tls=${USE_TLS}"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001"]
interval: 1m
timeout: 15s
retries: 15
#start_period: 30s
provisioner:
image: "${CONTAINER_REGISTRY}/provisioner:${PROVISIONER_TAG}"
depends_on:
- postgres
- mongodb
- auth
environment:
- RUST_LOG=${RUST_LOG}
networks:
user-net:
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
update_config:
order: start-first
failure_action: rollback
delay: 10s
rollback_config:
parallelism: 0
order: stop-first
placement:
constraints:
- node.hostname==provisioner
command:
- "--ip=0.0.0.0"
- "--port=8000"
- "--shared-pg-uri=postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres"
- "--shared-mongodb-uri=mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@mongodb:27017/admin"
- "--internal-mongodb-address=mongodb"
- "--internal-pg-address=postgres"
- "--fqdn=${DB_FQDN}"
- "--auth-uri=http://auth:8000"
postgres:
image: "${CONTAINER_REGISTRY}/postgres:${POSTGRES_TAG}"
restart: always
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
networks:
user-net:
volumes:
- postgres-vol:/var/lib/postgresql/data
ports:
- 8002:8000
- 5432:5432
deploy:
placement:
constraints:
- node.hostname==postgres
mongodb:
image: docker.io/library/mongo:5.0.10
restart: always
networks:
user-net:
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
deploy:
placement:
constraints:
- node.hostname==postgres
otel-collector:
image: "${CONTAINER_REGISTRY}/otel:${OTEL_TAG}"
volumes:
# Pull docker stats
- ${DOCKER_SOCK}:/var/run/docker.sock:ro
restart: always
networks:
user-net:
environment:
- DD_API_KEY=${DD_API_KEY}
- DD_ENV=${DD_ENV}
deploy:
placement:
constraints:
- node.hostname==controller
panamax:
image: "${CONTAINER_REGISTRY}/panamax:${PANAMAX_TAG}"
restart: always
networks:
user-net:
volumes:
- panamax-crates-vol:/mirror/crates
- panamax-io-index-vol:/mirror/crates.io-index
labels:
deck-chores.sync-mirror.command: panamax sync /mirror
deck-chores.sync-mirror.interval: 5 minutes
deck-chores.sync-mirror.max: 1
deploy:
placement:
constraints:
- node.hostname==controller
deck-chores:
image: docker.io/funkyfuture/deck-chores:1
restart: unless-stopped
environment:
TIMEZONE: UTC
volumes:
- ${DOCKER_SOCK}:/var/run/docker.sock
deploy:
placement:
constraints:
- node.hostname==controller