This commit is contained in:
2025-12-15 17:55:32 +08:00
commit 28ab17324d
170 changed files with 18373 additions and 0 deletions

32
backend/Dockerfile.dev Normal file
View File

@@ -0,0 +1,32 @@
# 开发环境 Dockerfile
FROM golang:1.22-alpine AS builder
# 安装必要的工具
RUN apk add --no-cache git ca-certificates tzdata
# 设置工作目录
WORKDIR /app
# 复制 go mod 文件
COPY go.mod go.sum ./
# 设置 Go 代理
RUN go env -w GOPROXY=https://goproxy.cn,direct
# 下载依赖
RUN go mod download
# 复制源代码
COPY . .
# 设置时区
ENV TZ=Asia/Shanghai
# 安装 air 用于热重载
RUN go install github.com/air-verse/air@latest
# 暴露端口
EXPOSE 8080 9090
# 启动命令
CMD ["air", "-c", ".air.toml"]