you2api-bohesocool / Dockerfile
choging's picture
你的 commit 訊息,請清楚描述你的修改內容
5cff6e2
raw
history blame contribute delete
543 Bytes
# 使用最新的 Go 1.22 版本作为基础镜像
FROM golang:1.22-alpine
# 安装必要的系统依赖
RUN apk --no-cache add ca-certificates git
# 设置工作目录
WORKDIR /app
# 克隆项目代码
RUN git clone https://github.com/bohesocool/you2api.git .
# 下载依赖
RUN go mod download
# 构建应用
RUN CGO_ENABLED=0 GOOS=linux go build -o main .
# 设置环境变量
ENV PORT=8080
ENV ENABLE_PROXY=false
ENV PROXY_URL=""
ENV PROXY_TIMEOUT_MS=5000
ENV LOG_LEVEL=info
# 暴露端口
EXPOSE 8080
# 运行应用
CMD ["./main"]