-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
30 lines (27 loc) · 941 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
# Builder stage
FROM lukemathwalker/cargo-chef:latest-rust-1.57.0 as chef
WORKDIR /app
FROM chef as planner
COPY . .
# Compute a lock-like file for the project
RUN cargo chef prepare --recipe-path recipe.json
FROM chef as builder
COPY --from=planner /app/recipe.json recipe.json
# Build project dependencies, not the application itself
RUN cargo chef cook --release --recipe-path recipe.json
COPY . .
RUN cargo build --release
# Runtime stage
FROM debian:bullseye-slim AS runtime
WORKDIR /app
# Install OpenSSL
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends openssl ca-certificates \
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/deployments-tracking-bot deployments-tracking-bot
COPY --from=builder /app/messages messages
# Don't forget about environment variables!
ENTRYPOINT ["./deployments-tracking-bot"]