Spaces:
Paused
Paused
justincnn commited on
Commit ·
06edf9e
1
Parent(s): 629a8be
build: 添加 Go 代理配置并统一 Go 版本为 1.21
Browse files- Dockerfile +3 -0
- go.mod +1 -1
Dockerfile
CHANGED
|
@@ -2,6 +2,9 @@ FROM golang:1.21-alpine AS builder
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
|
|
|
|
|
|
| 5 |
COPY go.mod go.sum ./
|
| 6 |
RUN go mod download
|
| 7 |
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# 设置 Go 代理以加速依赖下载(针对国内网络)
|
| 6 |
+
ENV GOPROXY=https://goproxy.cn,direct
|
| 7 |
+
|
| 8 |
COPY go.mod go.sum ./
|
| 9 |
RUN go mod download
|
| 10 |
|
go.mod
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
module zai-proxy
|
| 2 |
|
| 3 |
-
go 1.
|
| 4 |
|
| 5 |
require (
|
| 6 |
github.com/corpix/uarand v0.2.0
|
|
|
|
| 1 |
module zai-proxy
|
| 2 |
|
| 3 |
+
go 1.21
|
| 4 |
|
| 5 |
require (
|
| 6 |
github.com/corpix/uarand v0.2.0
|