forked from pengchujin/v2rayDocker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
91 lines (74 loc) · 2.19 KB
/
Dockerfile
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#
# Builder
#
FROM abiosoft/caddy:builder as builder
ARG version="0.11.1"
ARG plugins="git,cors,realip,expires,cache"
RUN go get -v github.com/abiosoft/parent
RUN VERSION=${version} PLUGINS=${plugins} ENABLE_TELEMETRY=false /bin/sh /usr/bin/builder.sh
#
# Final stage
#
FROM alpine:3.8
# process wrapper
LABEL maintainer "sebs [email protected]"
# V2RAY
ARG TZ="Asia/Shanghai"
ENV TZ ${TZ}
ENV V2RAY_VERSION v4.19.1
ENV V2RAY_LOG_DIR /var/log/v2ray
ENV V2RAY_CONFIG_DIR /etc/v2ray/
ENV V2RAY_DOWNLOAD_URL https://github.com/v2ray/v2ray-core/releases/download/${V2RAY_VERSION}/v2ray-linux-64.zip
RUN apk upgrade --update \
&& apk add \
bash \
tzdata \
curl \
&& mkdir -p \
${V2RAY_LOG_DIR} \
${V2RAY_CONFIG_DIR} \
/tmp/v2ray \
&& curl -L -H "Cache-Control: no-cache" -o /tmp/v2ray/v2ray.zip ${V2RAY_DOWNLOAD_URL} \
&& pwd \
&& unzip /tmp/v2ray/v2ray.zip -d /tmp/v2ray/ \
&& mv /tmp/v2ray/v2ray /usr/bin \
&& mv /tmp/v2ray/v2ctl /usr/bin \
&& mv /tmp/v2ray/vpoint_vmess_freedom.json /etc/v2ray/config.json \
&& chmod +x /usr/bin/v2ray \
&& chmod +x /usr/bin/v2ctl \
&& apk del curl \
&& ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo ${TZ} > /etc/timezone \
&& rm -rf /tmp/v2ray /var/cache/apk/*
# ADD entrypoint.sh /entrypoint.sh
WORKDIR /srv
# node
# install node
RUN apk add --no-cache util-linux
RUN apk add --update nodejs nodejs-npm
COPY package.json /srv/package.json
RUN npm install
COPY v2ray.js /srv/v2ray.js
ARG version="0.11.1"
LABEL caddy_version="$version"
# Let's Encrypt Agreement
ENV ACME_AGREE="false"
# Telemetry Stats
ENV ENABLE_TELEMETRY="false"
RUN apk add --no-cache openssh-client git
# install caddy
COPY --from=builder /install/caddy /usr/bin/caddy
# validate install
RUN /usr/bin/caddy -version
RUN /usr/bin/caddy -plugins
VOLUME /root/.caddy /srv
# WORKDIR /srv
COPY Caddyfile /etc/Caddyfile
COPY index.html /srv/index.html
# COPY package.json /etc/package.json
# install process wrapper
COPY --from=builder /go/bin/parent /bin/parent
ADD caddy.sh /caddy.sh
EXPOSE 443 80
ENTRYPOINT ["/caddy.sh"]
# CMD ["--conf", "/etc/Caddyfile", "--log", "stdout", "--agree=$ACME_AGREE"]