Files
AntiCaptcha/Dockerfile
T
admin 524c404194
Build and Deploy / build-frontend (push) Failing after 2s
Build and Deploy / build-backend (push) Has been skipped
Build and Deploy / build-docker (push) Has been skipped
Build and Deploy / deploy (push) Has been skipped
feat: initial commit - Go + CGO captcha recognition service
Features:
- Go + CGO ONNX/OpenCV wrapper for high performance
- SQLite (default) / MySQL database support
- Optional Redis caching
- JWT authentication system
- Multiple captcha recognition APIs:
  - OCR text recognition
  - Slider captcha matching
  - Image similarity comparison
  - Rotation captcha detection
  - Object detection
- React frontend with install wizard
- Docker and docker-compose support
- Gitea CI/CD pipeline

Project structure:
- cmd/server: Main entry point
- internal/: Core business logic
- pkg/onnx: ONNX Runtime CGO wrapper
- pkg/opencv: OpenCV CGO wrapper
- web/: React frontend
- deploy/: Deployment configs
- scripts/: Utility scripts
2026-07-16 08:56:38 +00:00

40 lines
724 B
Docker

# 构建阶段
FROM golang:1.22-alpine AS builder
# 安装构建依赖
RUN apk add --no-cache git gcc g++ make opencv-dev onnxruntime-dev
WORKDIR /app
# 复制 Go 模块文件
COPY go.mod go.sum ./
RUN go mod download
# 复制源代码
COPY . .
# 构建
RUN CGO_ENABLED=1 go build -o anticaptcha ./cmd/server
# 运行阶段
FROM alpine:3.20
# 安装运行时依赖
RUN apk add --no-cache ca-certificates tzdata opencv onnxruntime
WORKDIR /app
# 复制二进制文件
COPY --from=builder /app/anticaptcha .
COPY --from=builder /app/models ./models
COPY --from=builder /app/web/dist ./web/dist
# 创建数据目录
RUN mkdir -p /app/data
ENV GIN_MODE=release
ENV TZ=Asia/Shanghai
EXPOSE 6688
CMD ["./anticaptcha"]