diff --git a/deploys/Dockerfile b/deploys/Dockerfile index 7b77aa3..ac7942b 100644 --- a/deploys/Dockerfile +++ b/deploys/Dockerfile @@ -1,16 +1,23 @@ -# Build Stage -FROM golang:1.24.0-alpine3.21 AS builder +# Modules Stage +FROM golang:1.24.4-alpine3.22 AS modules ENV GO111MODULE=on \ GOPROXY=https://goproxy.cn,direct +COPY go.mod go.sum /modules/ +WORKDIR /modules +RUN go mod download + +# Build Stage +FROM golang:1.24.4-alpine3.22 AS builder +COPY --from=modules /go/pkg /go/pkg WORKDIR /app -COPY ../.. . -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o testpaper main.go +COPY . . +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o management main.go # Run Stage -FROM zc1185230223/alpine:3.21 +FROM zc1185230223/alpine:3.22 WORKDIR /app -COPY --from=builder /app/testpaper . +COPY --from=builder /app/management . RUN touch config.yaml EXPOSE 15001 -CMD ["/app/testpaper", "api", "-c", "config.yaml"] \ No newline at end of file +CMD ["/app/management", "erp", "-c", "config.yaml"] \ No newline at end of file