forked from next-hat/nanocl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
251 lines (240 loc) · 6.8 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
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
243
244
245
246
247
248
249
250
251
version: "3.9"
volumes:
rust-cache:
name: "rust-cache"
nanocl-deps:
name: "nanocl-deps"
networks:
system:
name: system
driver: bridge
external: false
driver_opts:
com.docker.network.bridge.name: nanocl.system
services:
nstore:
container_name: nstore.system.c
hostname: store.nanocl.internal
image: cockroachdb/cockroach:v23.1.15
entrypoint: /bin/sh
tty: true
ports:
- 26257:26257
- 26258:26258
networks:
- system
volumes:
- ${STATE_DIR:-${HOME}/.nanocl_dev/state}/store:${STATE_DIR:-${HOME}/.nanocl_dev/state}/store
environment:
- STATE_DIR=${STATE_DIR:-${HOME}/.nanocl_dev/state}/store
labels:
- io.nanocl=enabled
- io.nanocl.kind=cargo
- io.nanocl.c=nstore.system
- io.nanocl.n=system
command:
- -c
- |
echo "starting cockroachdb"
if [ ! -f "$$STATE_DIR/ca/ca.key" ]; then
echo "generating certs"
mkdir -p $$STATE_DIR/ca $$STATE_DIR/certs $$STATE_DIR/data
cockroach cert create-ca --certs-dir=$$STATE_DIR/certs --ca-key=$$STATE_DIR/ca/ca.key
cockroach cert create-node 127.0.0.1 store.nanocl.internal --certs-dir=$$STATE_DIR/certs --ca-key=$$STATE_DIR/ca/ca.key
cockroach cert create-client root --certs-dir=$$STATE_DIR/certs --ca-key=$$STATE_DIR/ca/ca.key
fi
cockroach start-single-node --listen-addr=:26257 --sql-addr=:26258 --certs-dir=$$STATE_DIR/certs --store=$$STATE_DIR/data
nmetrics:
container_name: nmetrics.system.c
image: ghcr.io/next-hat/metrsd:0.5.2
tty: true
networks:
- system
environment:
- LOG_LEVEL=metrsd=info
command:
- --hosts
- unix:///run/nanocl/metrics.sock
labels:
- io.nanocl=enabled
- io.nanocl.kind=cargo
- io.nanocl.c=nmetrics.system
- io.nanocl.n=system
volumes:
- //run/guest-services/nanocl:/run/nanocl
nproxy:
container_name: nproxy.system.c
image: nproxy:dev
tty: true
network_mode: host
environment:
- STATE_DIR=${STATE_DIR:-${HOME}/.nanocl_dev/state}/proxy
labels:
- io.nanocl=enabled
- io.nanocl.kind=cargo
- io.nanocl.c=nproxy.system
- io.nanocl.n=system
volumes:
- //run/guest-services/nanocl:/run/nanocl
- ${STATE_DIR:-${HOME}/.nanocl_dev/state}/proxy:${STATE_DIR:-${HOME}/.nanocl_dev/state}/proxy
ncproxy:
container_name: ncproxy.system.c
image: ghcr.io/next-hat/nanocl-dev:dev
tty: true
ports:
- 8686:8686
networks:
- system
command:
- watch
- -w
- /project/bin/ncproxy/src
- -x
- run --no-default-features --features dev --bin ncproxy -- --state-dir ${STATE_DIR:-${HOME}/.nanocl_dev/state}/proxy
labels:
- io.nanocl=enabled
- io.nanocl.kind=cargo
- io.nanocl.c=ncproxy.system
- io.nanocl.n=system
volumes:
- type: bind
source: .
target: /project
- nanocl-deps:/project/target
- rust-cache:/usr/local/cargo/registry
- //run/guest-services/nanocl:/run/nanocl
- ${STATE_DIR:-${HOME}/.nanocl_dev/state}/proxy:${STATE_DIR:-${HOME}/.nanocl_dev/state}/proxy
ndns:
container_name: ndns.system.c
image: ndns:dev
tty: true
network_mode: host
environment:
- STATE_DIR=${STATE_DIR:-${HOME}/.nanocl_dev/state}/dns
labels:
- io.nanocl=enabled
- io.nanocl.kind=cargo
- io.nanocl.c=ndns.system
- io.nanocl.n=system
volumes:
- ${STATE_DIR:-${HOME}/.nanocl_dev/state}/dns:${STATE_DIR:-${HOME}/.nanocl_dev/state}/dns
ncdns:
container_name: ncdns.system.c
image: ghcr.io/next-hat/nanocl-dev:dev
tty: true
ports:
- 8787:8787
networks:
- system
command:
- watch
- -w
- /project/bin/ncdns/src
- -x
- run --no-default-features --features dev --bin ncdns -- --state-dir ${STATE_DIR:-${HOME}/.nanocl_dev/state}/dns
labels:
- io.nanocl=enabled
- io.nanocl.kind=cargo
- io.nanocl.c=ncdns.system
- io.nanocl.n=system
volumes:
- type: bind
source: .
target: /project
- nanocl-deps:/project/target
- rust-cache:/usr/local/cargo/registry
- //run/guest-services/nanocl:/run/nanocl
- ${STATE_DIR:-${HOME}/.nanocl_dev/state}/dns:${STATE_DIR:-${HOME}/.nanocl_dev/state}/dns
nanocld:
container_name: ndaemon.system.c
image: ghcr.io/next-hat/nanocl-dev:dev
tty: true
hostname: nanocl.internal
networks:
- system
ports:
- 8585:8585
- 9443:9443
labels:
- io.nanocl=enabled
- io.nanocl.kind=cargo
- io.nanocl.c=ndaemon.system
- io.nanocl.n=system
volumes:
- type: bind
source: .
target: /project
- nanocl-deps:/project/target
- rust-cache:/usr/local/cargo/registry
- /var/run/docker.sock:/run/docker.sock
- //run/guest-services/nanocl:/run/nanocl
- ${STATE_DIR:-${HOME}/.nanocl_dev/state}:${STATE_DIR:-${HOME}/.nanocl_dev/state}
command:
- watch
- -w
- /project/bin/nanocld/src
- -x
- |
run --no-default-features \
--features dev \
--bin nanocld \
-- \
--hosts unix:///run/nanocl/nanocl.sock \
--gid 1001 \
--hosts tcp://0.0.0.0:9443 \
--cert ./tests/server.crt \
--cert-key ./tests/server.key \
--cert-ca ./tests/ca.crt \
--state-dir ${STATE_DIR:-${HOME}/.nanocl_dev/state}
dbeaver:
container_name: dbeaver.system.c
image: dbeaver/cloudbeaver:23.2.4
tty: true
user: root
hostname: dbeaver.nanocl.internal
profiles:
- debug
networks:
- system
ports:
- 9090:8978
environment:
- PGADMIN_DEFAULT_PASSWORD=admin
labels:
- io.nanocl=enabled
- io.nanocl.kind=cargo
- io.nanocl.c=dbeaver.system
- io.nanocl.n=system
volumes:
- ${STATE_DIR:-${HOME}/.nanocl_dev}/dbeaver:/opt/cloudbeaver/workspace
ncvpnkit:
container_name: ncvpnkit.system.c
image: ghcr.io/next-hat/nanocl-dev:dev
tty: true
hostname: ncvpnkit.nanocl.internal
profiles:
- vpnkit
networks:
- system
environment:
- USER_HOME=${HOME}
labels:
- io.nanocl=enabled
- io.nanocl.kind=cargo
- io.nanocl.c=ndaemon.system
- io.nanocl.n=system
volumes:
- type: bind
source: .
target: /project
- nanocl-deps:/project/target
- rust-cache:/usr/local/cargo/registry
- //run/guest-services/nanocl:/run/nanocl
- //run/host-services/backend.sock:/run/host-services/backend.sock
command:
- watch
- -w
- /project/bin/ncvpnkit/src
- -x
- run --no-default-features --features dev --bin ncvpnkit