-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
22 lines (18 loc) · 688 Bytes
/
Copy pathDockerfile
File metadata and controls
22 lines (18 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM debian:bullseye-slim AS builder
ENV PATH="/root/.cargo/bin:${PATH}"
RUN apt -y update
RUN apt -y upgrade
RUN apt -y install build-essential curl libssl-dev cmake pkg-config
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN mkdir /build
WORKDIR /build
COPY . /build
RUN --mount=type=cache,target=/build/target \
--mount=type=cache,target=/root/.cargo/registry \
cargo build --release
RUN --mount=type=cache,target=/build/target \
mv /build/target/release/template-web-service .
FROM debian:bullseye-slim
COPY --from=builder /build/template-web-service /opt/template-web-service
EXPOSE 8080/tcp
CMD [ "/opt/template-web-service", "spawn" ]