Skip to content

Commit 0a255e3

Browse files
committed
feat: Add multi-stage Dockerfile for Rust backend with optimized build, dependency caching, and minimal runtime environment.
1 parent 2c11e00 commit 0a255e3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

backend/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
# Use latest stable Rust for building
3939
# Provides access to latest Rust features and optimizations
40-
FROM rust:1.82-bookworm AS builder
40+
FROM rust:1.83-bookworm AS builder
4141

4242
# Set working directory for all subsequent commands
4343
WORKDIR /app
@@ -61,7 +61,7 @@ RUN apt-get update && apt-get install -y \
6161
# Copy Cargo configuration files first to leverage Docker layer caching
6262
# This ensures dependencies are only rebuilt when Cargo.toml changes
6363
# Improves build performance significantly in CI/CD pipelines
64-
COPY Cargo.toml ./
64+
COPY Cargo.toml Cargo.lock* ./
6565

6666
# Ensure reproducible builds with Cargo.lock
6767
# Generate Cargo.lock if it doesn't exist for dependency pinning

0 commit comments

Comments
 (0)