File tree Expand file tree Collapse file tree 4 files changed +39
-20
lines changed Expand file tree Collapse file tree 4 files changed +39
-20
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,15 @@ COPY . .
20
20
RUN cargo build --release --target x86_64-unknown-linux-musl --bin cli
21
21
22
22
FROM scratch AS prod
23
+ WORKDIR /user
24
+ COPY config/00-default.toml 00-default.toml
23
25
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/cli /usr/local/bin/rust-server
24
- CMD ["/usr/local/bin/rust-server" ]
26
+ ENTRYPOINT ["/usr/local/bin/rust-server" , "--config-path=*.toml " ]
25
27
26
- FROM prod AS dev
28
+ FROM alpine AS dev
27
29
WORKDIR /user
30
+ COPY config/00-default.toml 00-default.toml
31
+ COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/cli /usr/local/bin/rust-server
28
32
COPY --from=bunyan /root/.cargo/bin/bunyan /usr/local/bin/
29
- CMD ["/usr/local/bin/rust-server | bunyan" ]
33
+ ENTRYPOINT ["/bin/sh" ]
34
+ CMD ["-c" , "/usr/local/bin/rust-server --config-path=*.toml | bunyan" ]
Original file line number Diff line number Diff line change @@ -4,14 +4,6 @@ exporter_endpoint = "http://localhost:7281"
4
4
[db ]
5
5
[[inmemory ]]
6
6
7
- [[pg ]]
8
- user = ' postgres'
9
- password = ' postgres'
10
- host = ' 127.0.0.1'
11
- port = 5432
12
- dbname = ' rust_template_db'
13
- pool.max_size = 16
14
-
15
7
[server ]
16
8
url = " 0.0.0.0"
17
9
port = 8000
Original file line number Diff line number Diff line change
1
+ service_name = " rust-api-server-docker"
2
+ exporter_endpoint = " http://quickwit:7281"
3
+
4
+ [server ]
5
+ url = " 0.0.0.0"
6
+ port = 8888
7
+
8
+ [log ]
9
+ level = " info"
10
+
11
+ [db .pg ]
12
+ url = " postgres://postgres:changeme@postgres:5432/postgres"
13
+ max_size = 10
Original file line number Diff line number Diff line change 1
- version : " 3.3 "
1
+ version : " 3.8 "
2
2
networks :
3
3
rust-api-server :
4
- name : " rust-api-server-local "
4
+ name : " rust-api-server-docker "
5
5
services :
6
6
quickwit :
7
7
image : quickwit/quickwit:latest
8
8
command : run
9
9
restart : always
10
10
environment :
11
- QW_ENABLE_OTLP_ENDPOINT : ' true'
12
- QW_ENABLE_JAEGER_ENDPOINT : ' true'
11
+ QW_ENABLE_OTLP_ENDPOINT : " true"
12
+ QW_ENABLE_JAEGER_ENDPOINT : " true"
13
13
ports :
14
- - ' 7280:7280'
15
- - ' 7281:7281'
14
+ - " 7280:7280"
15
+ - " 7281:7281"
16
16
jaeger :
17
17
image : jaegertracing/jaeger-query:latest
18
18
restart : always
19
19
depends_on :
20
20
- quickwit
21
21
environment :
22
- SPAN_STORAGE_TYPE : ' grpc-plugin'
23
- GRPC_STORAGE_SERVER : ' quickwit:7281'
22
+ SPAN_STORAGE_TYPE : " grpc-plugin"
23
+ GRPC_STORAGE_SERVER : " quickwit:7281"
24
24
ports :
25
- - ' 16686:16686'
25
+ - " 16686:16686"
26
26
postgres :
27
27
image : postgres
28
28
environment :
@@ -33,5 +33,14 @@ services:
33
33
- postgres:/data/postgres
34
34
ports :
35
35
- " 5432:5432"
36
+ server :
37
+ image : rust-server
38
+ build :
39
+ context : ../..
40
+ target : dev
41
+ ports :
42
+ - " 8888:8888"
43
+ volumes :
44
+ - ./01-custom.toml:/user/01-custom.toml:ro
36
45
volumes :
37
46
postgres:
You can’t perform that action at this time.
0 commit comments