Skip to content

Commit 1068227

Browse files
committed
feat: add cache layer in docker building
1 parent bd84f32 commit 1068227

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Dockerfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
FROM rust:1.65 as builder
2+
3+
RUN cargo new --bin app
24
WORKDIR /app
35
COPY Cargo.toml Cargo.toml
6+
# Dry running build command to make Docker cache layer
7+
RUN cargo build --release
8+
RUN rm src/*.rs
9+
410
COPY src src
511
RUN cargo build --release
12+
13+
# Use slim image to place build result
14+
FROM debian:stable-slim
15+
COPY --from=builder ./app/target/release/chatgpt-proxy-server .
616
EXPOSE 3000
7-
CMD ["./target/release/chatgpt-proxy-server"]
17+
CMD ["./chatgpt-proxy-server"]

0 commit comments

Comments
 (0)