17 lines
372 B
Docker
17 lines
372 B
Docker
# === Stage 1: 构建后端 ===
|
|
FROM golang:1.26-alpine AS builder
|
|
WORKDIR /build
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 go build -o pointly-tel .
|
|
|
|
# === Stage 2: 运行 ===
|
|
FROM alpine:3.19
|
|
WORKDIR /app
|
|
COPY --from=builder /build/pointly-tel .
|
|
COPY --from=builder /build/web/dist ./web/dist
|
|
COPY config.yml .
|
|
EXPOSE 80
|
|
CMD ["./pointly-tel"]
|