Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: dockerfile #489

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Use the official Rust image as a base
FROM rust:1.82-slim-bullseye AS builder

# Create a new empty shell project
WORKDIR /usr/src/app

# Copy the workspace files
COPY Cargo.toml ./

# Copy the crate directory
COPY crates ./crates

RUN apt-get update \
&& apt-get install -y protobuf-compiler \
&& rm -rf /var/lib/apt/lists/*
# Build dependencies
RUN cargo build --release -p cdk-mintd && \
rm -f target/release/deps/cdk_mintd*

# Build the actual application
RUN cargo build --release -p cdk-mintd

# Create a new stage with a minimal image
FROM debian:bullseye-slim

# Install needed runtime dependencies (if any)
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates && \
rm -rf /var/lib/apt/lists/*

# Copy the binary from builder
COPY --from=builder /usr/src/app/target/release/cdk-mintd /usr/local/bin/cdk-mintd

# Set the startup command
CMD ["cdk-mintd"]
Loading