-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (29 loc) · 866 Bytes
/
Copy pathDockerfile
File metadata and controls
44 lines (29 loc) · 866 Bytes
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
# ------------------ Base image ------------------
FROM rust:1.59 as base
WORKDIR /usr/src/app
COPY Cargo.toml .
COPY ./src src
RUN mkdir .cargo
RUN cargo vendor > .cargo/config
RUN cat .cargo/config
RUN rustup component add rustfmt clippy;
# ------------------- Builder --------------------
FROM base AS builder
RUN cargo build --release
RUN cargo install --path . --verbose
# ---------------- Executable image --------------
FROM debian:buster-slim as executable
COPY --from=builder /usr/local/cargo/bin/red-monkey /bin
RUN apt-get update \
&& apt-get install -y ca-certificates
RUN apt install libssl1.1
EXPOSE 8000
EXPOSE 6350
CMD ["/bin/red-monkey"]
# ----------------- Test Coverage -----------------
FROM rust:1.59 as test-coverage
WORKDIR /usr/src/app
COPY Cargo.lock .
COPY Cargo.toml .
COPY ./src src
RUN cargo install cargo-tarpaulin