-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-bin
30 lines (23 loc) · 1.5 KB
/
Dockerfile-bin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM --platform=${BUILDPLATFORM} node:18.18.2-bullseye as node-builder
WORKDIR /build
COPY elune/package.json .
RUN yarn config set registry 'https://registry.npmmirror.com' && \
yarn install
COPY elune .
RUN yarn build
FROM --platform=${BUILDPLATFORM} golang:1.21.5-alpine3.18 as go-builder
WORKDIR /build
RUN apk add make git upx && \
go env -w GOPROXY=https://goproxy.cn,direct
COPY elune-backend/go.mod elune-backend/go.sum ./
RUN go mod download
COPY elune-backend .
COPY --from=node-builder /build/dist pkg/server/static
RUN GOOS=linux GOARCH=amd64 make build-bin && chmod +x bin/elune-backend-linux-amd64 && tar zcvf bin/elune-backend-linux-amd64.tar.gz bin/elune-backend-linux-amd64 && \
GOOS=linux GOARCH=arm64 make build-bin && chmod +x bin/elune-backend-linux-arm64 && tar zcvf bin/elune-backend-linux-arm64.tar.gz bin/elune-backend-linux-arm64 && \
GOOS=darwin GOARCH=amd64 make build-bin && chmod +x bin/elune-backend-darwin-amd64 && tar zcvf bin/elune-backend-darwin-amd64.tar.gz bin/elune-backend-darwin-amd64 && \
GOOS=darwin GOARCH=arm64 make build-bin && chmod +x bin/elune-backend-darwin-arm64 && tar zcvf bin/elune-backend-darwin-arm64.tar.gz bin/elune-backend-darwin-arm64 && \
GOOS=windows GOARCH=amd64 make build-bin && tar zcvf bin/elune-backend-windows-amd64.tar.gz bin/elune-backend-windows-amd64 && \
GOOS=windows GOARCH=arm64 make build-bin && tar zcvf bin/elune-backend-windows-arm64.tar.gz bin/elune-backend-windows-arm64
FROM scratch
COPY --from=go-builder /build/bin /