1.修改代码适配阿里云的服务器

This commit is contained in:
whm
2026-03-17 14:27:32 +08:00
parent 826617d737
commit 20e7f3a65d
1777 changed files with 775041 additions and 10 deletions

View File

@@ -1,8 +1,12 @@
# 需在项目根目录构建: docker build -f server/Dockerfile .
# 使用 vendor 构建,无需在构建时访问 proxy.golang.org服务器无外网时也能 build
FROM golang:1.21-alpine AS builder
WORKDIR /build
COPY server/ ./
RUN go mod download && CGO_ENABLED=0 go build -o /app/server .
# 构建参数:脚本可传 GOPROXY避免 proxy.golang.org 超时;有 vendor 时主要用 -mod=vendor 离线构建
ARG GOPROXY=https://goproxy.cn,direct
ENV GOPROXY=$GOPROXY
RUN CGO_ENABLED=0 go build -mod=vendor -o /app/server .
FROM alpine:3.19
WORKDIR /app