MarketingSystemDataExportTool/Dockerfile

22 lines
805 B
Docker

FROM golang:1.21-alpine AS build
ARG ALPINE_MIRROR=mirrors.aliyun.com
RUN sed -i "s/dl-cdn.alpinelinux.org/${ALPINE_MIRROR}/g" /etc/apk/repositories || true
ARG GOPROXY=https://goproxy.cn,direct
ENV GOPROXY=$GOPROXY
WORKDIR /app
RUN --mount=type=cache,target=/var/cache/apk apk add build-base
COPY server/ ./server/
COPY web/ ./web/
WORKDIR /app/server
RUN go env -w GOPROXY=$GOPROXY && go build -o /app/bin/marketing-data-server ./cmd/server
FROM alpine:3.19
ARG ALPINE_MIRROR=mirrors.aliyun.com
RUN sed -i "s/dl-cdn.alpinelinux.org/${ALPINE_MIRROR}/g" /etc/apk/repositories || true
WORKDIR /app
COPY --from=build /app/bin/marketing-data-server /app/bin/marketing-data-server
COPY --from=build /app/web /app/web
RUN mkdir -p /app/storage/export
EXPOSE 8077
ENTRYPOINT ["/app/bin/marketing-data-server"]