Skip to content

Commit

Permalink
update docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
niteshbalusu11 committed Aug 8, 2024
1 parent b14cebb commit 15b97e1
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions Dockerfile
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"]

0 comments on commit 15b97e1

Please sign in to comment.