2021-06-08 20:45:26 +08:00
|
|
|
# web
|
|
|
|
FROM node:lts-alpine as builder_node
|
2022-04-07 16:33:16 +08:00
|
|
|
ENV VERSION 0.7.4
|
2021-06-08 20:45:26 +08:00
|
|
|
WORKDIR /web
|
|
|
|
COPY ./web /web
|
2022-04-07 16:33:16 +08:00
|
|
|
RUN yarn install \
|
|
|
|
&& yarn run build \
|
2021-06-08 20:45:26 +08:00
|
|
|
&& ls /web/ui
|
|
|
|
|
|
|
|
# server
|
2022-04-07 16:33:16 +08:00
|
|
|
FROM golang:1.17-alpine as builder_golang
|
2021-06-08 20:45:26 +08:00
|
|
|
#TODO 本地打包时使用镜像
|
2021-08-26 23:09:52 +08:00
|
|
|
ENV GOPROXY=https://goproxy.io
|
2021-06-08 20:45:26 +08:00
|
|
|
ENV GOOS=linux
|
|
|
|
WORKDIR /anylink
|
|
|
|
COPY . /anylink
|
|
|
|
COPY --from=builder_node /web/ui /anylink/server/ui
|
|
|
|
|
|
|
|
#TODO 本地打包时使用镜像
|
2021-08-26 23:09:52 +08:00
|
|
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
|
2021-08-02 20:41:35 +08:00
|
|
|
RUN apk add --no-cache git gcc musl-dev
|
2021-07-05 18:23:27 +08:00
|
|
|
RUN cd /anylink/server;go build -o anylink -ldflags "-X main.CommitId=$(git rev-parse HEAD)" \
|
2021-06-08 20:45:26 +08:00
|
|
|
&& /anylink/server/anylink tool -v
|
|
|
|
|
|
|
|
# anylink
|
|
|
|
FROM alpine
|
|
|
|
LABEL maintainer="github.com/bjdgyc"
|
|
|
|
|
|
|
|
ENV IPV4_CIDR="192.168.10.0/24"
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder_golang /anylink/server/anylink /app/
|
|
|
|
COPY docker_entrypoint.sh /app/
|
|
|
|
|
2021-08-26 23:09:52 +08:00
|
|
|
COPY ./server/bridge-init.sh /app/
|
2021-07-05 18:23:27 +08:00
|
|
|
COPY ./server/conf /app/conf
|
2021-12-31 20:21:26 +08:00
|
|
|
COPY ./LICENSE /app/LICENSE
|
2021-07-05 18:23:27 +08:00
|
|
|
|
|
|
|
|
2021-06-08 20:45:26 +08:00
|
|
|
#TODO 本地打包时使用镜像
|
2021-08-26 23:09:52 +08:00
|
|
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
|
2021-06-08 20:45:26 +08:00
|
|
|
RUN apk add --no-cache bash iptables \
|
|
|
|
&& chmod +x /app/docker_entrypoint.sh \
|
|
|
|
&& ls /app
|
|
|
|
|
|
|
|
EXPOSE 443 8800
|
|
|
|
|
|
|
|
#CMD ["/app/anylink"]
|
|
|
|
ENTRYPOINT ["/app/docker_entrypoint.sh"]
|
|
|
|
|