Update Dockerfile
Browse files- Dockerfile +18 -7
Dockerfile
CHANGED
@@ -1,8 +1,19 @@
|
|
1 |
-
FROM
|
2 |
-
WORKDIR /app
|
3 |
RUN apt-get update && apt-get install -y git
|
4 |
-
RUN git clone https://github.com/
|
5 |
-
RUN
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM rust:1.65 as builder
|
|
|
2 |
RUN apt-get update && apt-get install -y git
|
3 |
+
RUN git clone https://github.com/fuergaosi233/chatgpt-proxy-server.git
|
4 |
+
RUN cargo new --bin app
|
5 |
+
WORKDIR /app
|
6 |
+
COPY Cargo.toml Cargo.toml
|
7 |
+
# Dry running build command to make Docker cache layer
|
8 |
+
RUN cargo build --release
|
9 |
+
RUN rm src/*.rs
|
10 |
+
|
11 |
+
COPY src src
|
12 |
+
RUN cargo build --release
|
13 |
+
|
14 |
+
# Use slim image to place build result
|
15 |
+
FROM debian:stable-slim
|
16 |
+
RUN apt-get update && apt-get install -y ca-certificates
|
17 |
+
COPY --from=builder ./app/target/release/chatgpt-proxy-server .
|
18 |
+
EXPOSE 3000
|
19 |
+
CMD ["./chatgpt-proxy-server"]
|