-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.build
More file actions
28 lines (26 loc) · 915 Bytes
/
Dockerfile.build
File metadata and controls
28 lines (26 loc) · 915 Bytes
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
FROM golang:1.19.1 as back-builder
RUN apt update -y
RUN apt install -y libpcap-dev
WORKDIR /go/src
ADD ./back /go/src
RUN go mod tidy
RUN go install github.com/Songmu/gocredits/cmd/gocredits@v0.3.0
RUN make build
FROM node:16.17.1 as front-builder
RUN mkdir /code
WORKDIR /code
ADD ./front /code/
RUN yarn install
RUN yarn build
FROM alpine:3.14.2
RUN apk add --no-cache ca-certificates
RUN mkdir -p /tmp/{back,front}
COPY --from=back-builder /go/src/dist /tmp/back
COPY --from=front-builder /code/dist /tmp/front
RUN cat /tmp/back/NOTICE.txt /tmp/front/NOTICE.txt > /tmp/NOTICE.txt
RUN rm /tmp/back/NOTICE.txt /tmp/front/NOTICE.txt
RUN mkdir -p /build/windows/html
RUN mkdir -p /build/linux/html
RUN echo /build /build/windows/ /build/linux/ | xargs -n 1 cp /tmp/NOTICE.txt
RUN cp -r /tmp/back/windows /tmp/back/linux /build/
RUN echo /build/windows/html/ /build/linux/html/ | xargs -n 1 cp -v -r -T /tmp/front