-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (28 loc) · 1006 Bytes
/
Dockerfile
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
# Setup
FROM clux/muslrust:stable AS setup
RUN cargo install cargo-chef
WORKDIR /src
FROM setup as prepare
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
# Cache
FROM setup as cook
COPY --from=prepare /src/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
# Build
FROM cook as build
COPY . .
RUN cargo build --release
# Runtimes
FROM scratch AS runtime-auth
COPY --from=build /src/target/x86_64-unknown-linux-musl/release/cotonou-auth /
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
CMD ["/cotonou-auth"]
FROM scratch AS runtime-notif
COPY --from=build /src/target/x86_64-unknown-linux-musl/release/cotonou-notif /
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
CMD ["/cotonou-notif"]
FROM scratch AS runtime-mms
COPY --from=build /src/target/x86_64-unknown-linux-musl/release/cotonou-matchmaking-service /
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
CMD ["/cotonou-matchmaking-service"]