Skip to content
Merged
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
16 changes: 14 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ WORKDIR /usr/src/app
# Planner Stage - Analyze Dependencies
###################
FROM chef AS planner
COPY . .
COPY Cargo.toml ./
COPY migration/Cargo.toml ./migration/
COPY entity/Cargo.toml ./entity/
COPY src ./src
COPY migration/src ./migration/src
COPY entity/src ./entity/src
RUN cargo chef prepare --recipe-path recipe.json

###################
Expand All @@ -26,12 +31,19 @@ RUN apt-get update && apt-get install -y \
sqlite3 \
&& rm -rf /var/lib/apt/lists/*

# Copy Cargo.toml files for workspace structure
COPY Cargo.toml ./
COPY migration/Cargo.toml ./migration/
COPY entity/Cargo.toml ./entity/

# Build dependencies first (cached layer)
COPY --from=planner /usr/src/app/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json

# Copy source code and build application
COPY . .
COPY src ./src
COPY migration/src ./migration/src
COPY entity/src ./entity/src
RUN cargo build --release

###################
Expand Down
Loading