FROM golang:1.21-alpine AS build ENV GOPROXY=https://goproxy.cn,direct RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories WORKDIR /app RUN apk add --no-cache build-base COPY server/ ./server/ COPY web/ ./web/ WORKDIR /app/server RUN go build -o /app/bin/marketing-data-server ./cmd/server FROM alpine:3.19 RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories WORKDIR /app COPY --from=build /app/bin/marketing-data-server /app/bin/marketing-data-server COPY --from=build /app/web /app/web COPY --from=build /app/server/config.test.yaml /app/server/config.test.yaml COPY --from=build /app/server/config.prod.yaml /app/server/config.prod.yaml RUN mkdir -p /app/storage/export ENV APP_ENV=prod EXPOSE 8077 ENTRYPOINT ["/app/bin/marketing-data-server"]