rr1 commited on
Commit
bff675c
·
verified ·
1 Parent(s): 2d48552

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -0
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Builder Stage - 使用明确的版本并优化缓存
2
+ FROM golang:1.24-alpine as builder
3
+
4
+ # 设置工作目录
5
+ WORKDIR /app
6
+
7
+ # 安装 git
8
+ RUN apt-get update && apt-get install -y git
9
+
10
+ # 使用 git clone 获取源码
11
+ RUN git clone https://github.com/zouyq/jetbrains-ai-proxy.git .
12
+
13
+ # 2. 下载依赖项。这一步会被缓存,只有在 go.mod/go.sum 变化时才会重新运行
14
+ RUN go mod download
15
+
16
+ # 3. 编译应用。现在此步骤将使用缓存的依赖
17
+ RUN go build -o jetbrains-ai-proxy
18
+
19
+ # Final Stage - 保持不变
20
+ FROM alpine
21
+
22
+ COPY --from=builder /app/jetbrains-ai-proxy /usr/local/bin/
23
+
24
+ ENTRYPOINT ["jetbrains-ai-proxy"]