mirror of
https://gitee.com/fit2cloud-feizhiyun/1Panel.git
synced 2024-11-30 02:47:51 +08:00
da155fadf2
* feat: 使用 goreleaser 构建包 Signed-off-by: 吴小白 <296015668@qq.com>
34 lines
670 B
Docker
34 lines
670 B
Docker
FROM node:18.14 as build_web
|
|
ARG TARGETARCH
|
|
ARG NPM_REGISTRY="https://registry.npmmirror.com"
|
|
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
|
|
|
WORKDIR /data
|
|
|
|
RUN set -ex \
|
|
&& npm config set registry ${NPM_REGISTRY}
|
|
|
|
ADD . /data
|
|
|
|
RUN set -ex \
|
|
&& cd /data/frontend \
|
|
&& npm install
|
|
|
|
RUN set -ex \
|
|
&& cd /data/frontend \
|
|
&& npm run build:dev
|
|
|
|
FROM golang:1.20
|
|
ARG TARGETARCH
|
|
ARG GOPROXY="https://goproxy.cn,direct"
|
|
|
|
COPY --from=build_web /data /data
|
|
|
|
WORKDIR /data
|
|
|
|
RUN set -ex \
|
|
&& go env -w GOPROXY=${GOPROXY} \
|
|
&& go install github.com/goreleaser/goreleaser@latest \
|
|
&& goreleaser build --single-target --snapshot --clean
|
|
|
|
CMD ["/bin/bash"] |