-
Notifications
You must be signed in to change notification settings - Fork 361
/
Dockerfile
100 lines (82 loc) · 2.44 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
92
93
94
95
96
97
98
99
100
#
# Builder
#
FROM abiosoft/caddy:builder as builder
# add this line before you run `/bin/sh /usr/bin/builder.sh`
ADD https://raw.githubusercontent.com/jeffreystoke/caddy-docker/master/builder/builder.sh /usr/bin/builder.sh
ARG version="1.0.3"
ARG plugins=""
ARG enable_telemetry="false"
RUN go get -v github.com/abiosoft/parent
RUN VERSION=${version} PLUGINS=${plugins} ENABLE_TELEMETRY=${enable_telemetry} /bin/sh /usr/bin/builder.sh
#
# Final stage
#
FROM alpine:3.10
# process wrapper
LABEL maintainer "sebs sebsclub@outlook.com"
# V2RAY
ARG TZ="Asia/Shanghai"
ENV TZ ${TZ}
ENV V2RAY_VERSION v4.28.2
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="1.0.3"
LABEL caddy_version="$version"
# Let's Encrypt Agreement
ENV ACME_AGREE="false"
# Telemetry Stats
ENV ENABLE_TELEMETRY="$enable_telemetry"
RUN apk add --no-cache \
ca-certificates \
git \
mailcap \
openssh-client \
tzdata
# 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 2015
ENTRYPOINT ["/caddy.sh"]
# CMD ["--conf", "/etc/Caddyfile", "--log", "stdout", "--agree=$ACME_AGREE"]