-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b14cebb
commit 15b97e1
Showing
1 changed file
with
3 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,25 @@ | ||
# First stage: Build the Rust application | ||
FROM rust:1.72.1 AS builder | ||
|
||
# Install system dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y cmake pkg-config && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Set up the working directory | ||
WORKDIR /app | ||
|
||
# Copy the Rust project's source files | ||
COPY . . | ||
|
||
# Build the Rust project | ||
RUN cargo build --release | ||
|
||
# Second stage: Create a smaller runtime image | ||
FROM debian:buster-slim | ||
|
||
FROM debian:bullseye-slim | ||
# Install necessary runtime dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y libssl-dev ca-certificates && \ | ||
apt-get install -y libssl1.1 ca-certificates && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy the compiled binary from the builder stage | ||
COPY --from=builder /app/target/release/rustdress /usr/local/bin/ | ||
|
||
# Run the Rust binary | ||
CMD ["rustdress"] | ||
CMD ["rustdress"] |