Files
OpenFlare/docker/Dockerfile.backend
T
ryan fb6a3edb89 refactor(architecture): eliminate internal package and complete cordis single-owner model and repository migration
- Physically purged all legacy internal/ packages, centralized pkg/model/ and pkg/repository/
- Migrated domain models and database repositories into self-contained owner plugins (user, auth, message_gateway, admin, upload, risk_control)
- Decoupled cross-plugin interactions via pure core/contracts and typed EventBus
- Ensured 100% test coverage pass, zero data races (-race clean), and 0 lint issues in make code-check
2026-08-28 08:40:43 +08:00

43 lines
855 B
Docker

# syntax=docker/dockerfile:1.7
ARG GO_VERSION=1.25
ARG ALPINE_VERSION=3.23
FROM golang:${GO_VERSION}-alpine AS builder
ARG VERSION=dev
ARG BUILD_DATE=""
RUN apk add --no-cache ca-certificates git
WORKDIR /workspace
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build \
-trimpath \
-ldflags="-s -w -X github.com/Rain-kl/Wavelet/pkg/buildinfo.Version=${VERSION} -X github.com/Rain-kl/Wavelet/pkg/buildinfo.BuildTime=${BUILD_DATE}" \
-o /out/wavelet \
./main.go
FROM alpine:${ALPINE_VERSION}
ARG TZ=Asia/Shanghai
RUN apk add --no-cache ca-certificates tzdata postgresql-client && \
cp /usr/share/zoneinfo/${TZ} /etc/localtime && \
echo "${TZ}" > /etc/timezone
WORKDIR /app
COPY --from=builder /out/wavelet ./wavelet
COPY docs ./docs
EXPOSE 8000
ENTRYPOINT ["./wavelet"]
CMD ["api"]