jb2a / Dockerfile
rr1's picture
Update Dockerfile
c93c1e0 verified
raw
history blame contribute delete
616 Bytes
# Builder Stage - 使用明确的版本并优化缓存
FROM golang:1.24-alpine as builder
# 设置工作目录
WORKDIR /app
# 安装 git
RUN apk add --no-cache git
# 使用 git clone 获取源码
RUN git clone https://github.com/zouyq/jetbrains-ai-proxy.git .
# 2. 下载依赖项。这一步会被缓存,只有在 go.mod/go.sum 变化时才会重新运行
RUN go mod download
# 3. 编译应用。现在此步骤将使用缓存的依赖
RUN go build -o jetbrains-ai-proxy
# Final Stage - 保持不变
FROM alpine
COPY --from=builder /app/jetbrains-ai-proxy /usr/local/bin/
ENTRYPOINT ["jetbrains-ai-proxy"]