-
Notifications
You must be signed in to change notification settings - Fork 38
/
Dockerfile
39 lines (36 loc) · 1.12 KB
/
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
# Stage 1: Build the application
FROM rust:1.81 AS builder
# Install build dependencies
RUN apt-get -y update && \
apt-get install -y clang && \
apt-get autoremove -y; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /usr/src/madara/
# Copy the source code into the container
COPY Cargo.toml Cargo.lock ./
COPY crates crates
COPY cairo-artifacts cairo-artifacts
# Install runtime dependencies
RUN apt-get -y update && \
apt-get install -y openssl ca-certificates busybox && \
apt-get autoremove -y; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*
# Build the application in release mode
RUN cargo build --release
# Stage 2: Create the final runtime image
FROM debian:bookworm
# Install runtime dependencies
RUN apt-get -y update && \
apt-get install -y openssl ca-certificates tini curl &&\
apt-get autoremove -y; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /usr/local/bin
# Copy the compiled binary from the builder stage
COPY --from=builder /usr/src/madara/target/release/madara .
# Set the entrypoint
ENTRYPOINT ["./madara"]