Files
AntiCaptcha/Dockerfile
T
admin 8258160f95
Build and Deploy / build (push) Failing after 52s
Build and Deploy / deploy (push) Has been skipped
fix: simplify CI/CD and Dockerfile
- Use github.actor instead of gitea.actor
- Add act-latest container for Gitea Actions
- Simplify Dockerfile to use alpine
- Remove CGO dependencies
- Fix frontend build path
2026-07-16 10:33:23 +00:00

32 lines
554 B
Docker

# 构建阶段
FROM golang:1.22-alpine AS builder
WORKDIR /app
# 复制源代码
COPY . .
# 构建
RUN go mod download || true
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o anticaptcha ./cmd/server
# 运行阶段
FROM alpine:3.20
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app
# 复制二进制文件和前端
COPY --from=builder /app/anticaptcha .
COPY --from=builder /app/web/dist ./web/dist
# 创建目录
RUN mkdir -p /app/data /app/models
ENV GIN_MODE=release
ENV TZ=Asia/Shanghai
EXPOSE 6688
CMD ["./anticaptcha"]