refactor: update match configuration and user matching logic
- Changed the daily free match limit to a lifetime limit, aligning with backend configurations. - Updated the match price display to include original pricing for better user clarity. - Refactored match quota handling to sync with the server, ensuring accurate match counts and purchase statuses. - Enhanced UI messages to reflect changes in match availability and pricing. - Removed deprecated logic related to daily match counts, streamlining the matching process.
This commit is contained in:
@@ -1,40 +1,37 @@
|
||||
# soul-api Docker 镜像
|
||||
# 多阶段构建:编译 Go 二进制 → 精简运行镜像
|
||||
# 构建:在 soul-api 根目录执行 docker build -f deploy/Dockerfile -t soul-api:latest .
|
||||
# 运行:见 docker-compose.production.yml
|
||||
|
||||
# ========== 阶段 1:编译 ==========
|
||||
# 使用本地已缓存的 golang:1.25;deploy.py 加 --pull=false 避免拉取
|
||||
FROM golang:1.25 AS builder
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates git && rm -rf /var/lib/apt/lists/*
|
||||
WORKDIR /src
|
||||
|
||||
WORKDIR /build
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
|
||||
-ldflags="-w -s" -o /build/soul-api ./cmd/server
|
||||
|
||||
# ========== 阶段 2:运行 ==========
|
||||
# 使用标准引用 alpine:3.19,配合 --pull=false 可使用本地已缓存的镜像
|
||||
# Build server binary
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o /out/soul-api ./cmd/server
|
||||
|
||||
FROM alpine:3.19
|
||||
|
||||
RUN apk add --no-cache ca-certificates tzdata wget
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
RUN adduser -D -g '' appuser
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /build/soul-api .
|
||||
RUN apk add --no-cache ca-certificates tzdata wget && \
|
||||
addgroup -S app && adduser -S -G app app
|
||||
|
||||
COPY --from=builder /out/soul-api /app/soul-api
|
||||
COPY certs/ /app/certs/
|
||||
|
||||
ARG ENV_FILE=.env.production
|
||||
COPY ${ENV_FILE} /app/.env
|
||||
# Runtime directories used by the app
|
||||
RUN mkdir -p /app/uploads /app/log && chown -R app:app /app
|
||||
|
||||
RUN mkdir -p /app/uploads && chown -R appuser:appuser /app
|
||||
USER appuser
|
||||
ENV APP_ENV=production
|
||||
ENV GIN_MODE=release
|
||||
ENV PORT=8080
|
||||
ENV UPLOAD_DIR=/app/uploads
|
||||
ENV WECHAT_CERT_PATH=/app/certs/apiclient_cert.pem
|
||||
ENV WECHAT_KEY_PATH=/app/certs/apiclient_key.pem
|
||||
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["./soul-api"]
|
||||
|
||||
USER app
|
||||
|
||||
CMD ["/app/soul-api"]
|
||||
|
||||
Reference in New Issue
Block a user