File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -6,15 +6,12 @@ WORKDIR /app
66# Copy Cargo files
77COPY Cargo.toml Cargo.lock ./
88
9- # Create dummy main.rs for caching (optional)
10- RUN mkdir -p src && echo "fn main() {}" > src/main.rs
9+ # Fetch dependencies without building the app
10+ RUN cargo fetch
1111
12- # Build dependencies
13- RUN cargo build --release
14-
15- # Copy source code and sqlx metadata
12+ # Copy the source code and SQLx metadata
1613COPY . .
17- COPY .sqlx .
14+ COPY .sqlx .
1815
1916# Enable offline mode for SQLx
2017ENV SQLX_OFFLINE=true
@@ -34,10 +31,10 @@ RUN apt-get update && apt-get install -y \
3431WORKDIR /app
3532
3633# Copy the migrations folder to the runtime stage
37- # COPY --from=builder /app/migrations ./migrations
34+ COPY --from=builder /app/migrations ./migrations
3835
3936# Copy the binary
4037COPY --from=builder /app/target/release/api .
4138
4239EXPOSE 8000
43- CMD ["./api" ]
40+ CMD ["./api" ]
You can’t perform that action at this time.
0 commit comments