-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (23 loc) · 939 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
35
36
37
38
39
FROM debian:bullseye as builder
ENV RUNTIME_FOLDER=/root/workspace \
RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=%%RUST-VERSION%%
WORKDIR ${RUNTIME_FOLDER}
COPY . ${RUNTIME_FOLDER}
RUN apt-get update -y && apt-get install pkg-config libssl-dev build-essential cmake curl -y
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
. $CARGO_HOME/env && \
cargo install --path .
# final docker image
FROM debian:bullseye-slim
ENV RUNTIME_FOLDER=/root/workspace
WORKDIR ${RUNTIME_FOLDER}
COPY --from=builder ${RUNTIME_FOLDER}/.env ${RUNTIME_FOLDER}
COPY --from=builder /usr/local/cargo/bin/core-rusty-api /usr/local/bin
RUN apt-get update -y && apt-get install vim ca-certificates -y && apt-get clean
EXPOSE 1342
VOLUME [ "/root/workspace/runtime" ]
ENTRYPOINT [ "/bin/bash", "-l", "-c" ]
CMD ["core-rusty-api"]