-
Notifications
You must be signed in to change notification settings - Fork 150
/
Dockerfile.cn
43 lines (36 loc) · 1.05 KB
/
Dockerfile.cn
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
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM node:lts-alpine as builderNodeJSCache
ADD ui/package.json /app/package.json
WORKDIR /app
RUN npm i
FROM node:lts-alpine as builderNodeJS
ADD ui /app
WORKDIR /app
COPY --from=builderNodeJSCache /app/node_modules /app/node_modules
RUN npm run build \
&& chmod -R 650 /app/dist
FROM alpine:3 as builderGolang
ADD backend /app
WORKDIR /app
COPY --from=builderNodeJS /app/dist /app/embed/ui
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
apk add --no-cache go && \
go env -w GO111MODULE=on && \
go env -w GOPROXY=https://goproxy.cn,direct
RUN go build -o als && \
chmod +x als
FROM alpine:3 as builderEnv
WORKDIR /app
ADD scripts /app
RUN sh /app/install-software.sh
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
apk add --no-cache \
iperf iperf3 \
mtr \
traceroute \
iputils
RUN rm -rf /app
FROM alpine:3
LABEL maintainer="samlm0 <update@ifdream.net>"
COPY --from=builderEnv / /
COPY --from=builderGolang --chmod=777 /app/als/als /bin/als
CMD /bin/als