2021-09-02 19:28:02 +08:00
|
|
|
FROM mzz2017/git:alpine AS version
|
|
|
|
WORKDIR /build
|
|
|
|
ADD .git ./.git
|
2021-09-06 18:59:48 +08:00
|
|
|
RUN export date="$(git log -1 --format="%cd" --date=short | sed s/-//g)" && \
|
|
|
|
export count="$(git rev-list --count HEAD)" && \
|
|
|
|
export commit="$(git rev-parse --short HEAD)" && \
|
|
|
|
echo "$date.r${count}.$commit" | tee ./version
|
2021-09-02 19:28:02 +08:00
|
|
|
|
|
|
|
|
2021-08-11 16:41:42 +08:00
|
|
|
FROM node:lts-alpine AS builder-web
|
|
|
|
ADD gui /build/gui
|
|
|
|
WORKDIR /build/gui
|
|
|
|
RUN echo "network-timeout 600000" >> .yarnrc
|
2022-02-14 19:23:16 +08:00
|
|
|
#RUN yarn config set registry https://registry.npmmirror.com
|
2021-08-11 16:41:42 +08:00
|
|
|
#RUN yarn config set sass_binary_site https://cdn.npm.taobao.org/dist/node-sass -g
|
2023-08-02 23:54:07 +08:00
|
|
|
RUN yarn cache clean && yarn && yarn build
|
2021-08-11 16:41:42 +08:00
|
|
|
|
|
|
|
FROM golang:alpine AS builder
|
|
|
|
ADD service /build/service
|
|
|
|
WORKDIR /build/service
|
2021-08-11 16:51:54 +08:00
|
|
|
COPY --from=builder-web /build/web server/router/web
|
2021-09-06 17:56:05 +08:00
|
|
|
COPY --from=version /build/version ./
|
2021-09-02 19:28:02 +08:00
|
|
|
RUN export VERSION=$(cat ./version) && CGO_ENABLED=0 go build -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=unstable-${VERSION} -s -w" -o v2raya .
|
2021-08-11 16:41:42 +08:00
|
|
|
|
|
|
|
FROM v2fly/v2fly-core
|
|
|
|
COPY --from=builder /build/service/v2raya /usr/bin/
|
|
|
|
RUN wget -O /usr/local/share/v2ray/LoyalsoldierSite.dat https://raw.githubusercontent.com/mzz2017/dist-v2ray-rules-dat/master/geosite.dat
|
|
|
|
RUN apk add --no-cache iptables ip6tables
|
|
|
|
EXPOSE 2017
|
|
|
|
VOLUME /etc/v2raya
|
|
|
|
ENTRYPOINT ["v2raya"]
|
|
|
|
|