v2rayA/Dockerfile

29 lines
1.0 KiB
Docker
Raw Normal View History

FROM mzz2017/git:alpine AS version
WORKDIR /build
ADD .git ./.git
2021-09-06 18:59:48 +08:00
RUN git describe --abbrev=0 --tags | tee ./version
2020-08-20 07:20:45 +08:00
FROM node:lts-alpine AS builder-web
ADD gui /build/gui
WORKDIR /build/gui
2020-10-15 23:55:28 +08:00
RUN echo "network-timeout 600000" >> .yarnrc
2020-10-15 23:40:52 +08:00
#RUN yarn config set registry https://registry.npm.taobao.org
#RUN yarn config set sass_binary_site https://cdn.npm.taobao.org/dist/node-sass -g
RUN yarn cache clean && yarn && yarn build
2020-08-20 07:20:45 +08:00
2021-08-09 23:34:20 +08:00
FROM golang:alpine AS builder
ADD service /build/service
WORKDIR /build/service
COPY --from=version /build/version ./
2021-08-11 16:51:54 +08:00
COPY --from=builder-web /build/web server/router/web
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=${VERSION:1} -s -w" -o v2raya .
2021-08-09 23:34:20 +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 tzdata
EXPOSE 2017
2020-10-15 23:05:51 +08:00
VOLUME /etc/v2raya
2021-08-09 23:34:20 +08:00
ENTRYPOINT ["v2raya"]