From fdca29790042cc3782c54a5ba0cb1f6631d3da98 Mon Sep 17 00:00:00 2001 From: jonny <475634114@qq.com> Date: Tue, 30 Mar 2021 15:53:13 +0800 Subject: [PATCH] Create Dockerfile --- Dockerfile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..44f0d01 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM golang:alpine as builder +ENV GOPROXY=https://goproxy.io \ + GO111MODULE=on \ + GOOS=linux +WORKDIR /root/ +RUN apk add --no-cache --update bash git g++ nodejs npm \ + && git clone https://github.com/bjdgyc/anylink.git \ + && cd anylink/server \ + && go build -o anylink -ldflags "-X main.COMMIT_ID=$(git rev-parse HEAD)" \ + && cd ../web \ + && npm install \ + && npx browserslist@latest --update-db \ + && npm run build + + +FROM golang:alpine +LABEL maintainer="www.mrdoc.fun" +COPY --from=builder /root/anylink/server /app/ +COPY --from=builder /root/anylink/web/ui /app/ui/ +COPY docker/ /app/ +WORKDIR /app +RUN apk add --no-cache pwgen bash iptables openssl ca-certificates \ + && rm -f /app/conf/server.toml \ + && chmod +x docker_entrypoint.sh + +ENTRYPOINT ["./docker_entrypoint.sh"]