2021-04-10 08:21:07 +00:00
|
|
|
FROM alpine:latest
|
|
|
|
|
|
|
|
|
|
|
|
ENV VERSION=var_VERSION
|
|
|
|
ENV URL https://github.com/XTLS/Xray-core/releases/download/v${VERSION}/Xray-linux-64.zip
|
|
|
|
|
2021-04-19 07:51:22 +00:00
|
|
|
COPY image/run.sh /opt/run.sh
|
2021-04-22 09:01:45 +00:00
|
|
|
COPY image/crypt.sh /opt/crypt.sh
|
|
|
|
COPY image/nginx /opt/nginx
|
2021-04-19 07:51:22 +00:00
|
|
|
COPY image/crontab /var/spool/cron/crontabs/root
|
2021-04-10 08:21:07 +00:00
|
|
|
|
|
|
|
RUN set -xe && \
|
|
|
|
mkdir -p /opt/config && \
|
|
|
|
mkdir -p /opt/config/logs && \
|
|
|
|
mkdir -p /opt/config/certs && \
|
|
|
|
mkdir -p /opt/config/logs/nginx && \
|
|
|
|
mkdir -p /opt/config/logs/xray && \
|
|
|
|
mkdir -p /opt/config/logs/crond && \
|
2021-04-10 09:40:04 +00:00
|
|
|
mkdir -p /opt/xray && \
|
2021-04-10 09:47:21 +00:00
|
|
|
ln -s /opt/config/certs /etc/letsencrypt && \
|
2021-04-22 09:01:45 +00:00
|
|
|
apk add --no-cache unzip wget nginx certbot openssl && \
|
2021-04-10 09:40:04 +00:00
|
|
|
wget ${URL} && \
|
|
|
|
unzip Xray-linux-64.zip -d /opt/xray && \
|
|
|
|
rm Xray-linux-64.zip && \
|
2021-04-10 10:36:23 +00:00
|
|
|
addgroup www && \
|
|
|
|
adduser -H -D -S -s /bin/false www -G www && \
|
2021-04-22 09:01:45 +00:00
|
|
|
chown -R www:www /opt/nginx && \
|
|
|
|
chmod +x /opt/run.sh /opt/crypt.sh && \
|
|
|
|
apk del unzip wget
|
2021-04-10 08:21:07 +00:00
|
|
|
|
2021-04-10 10:37:39 +00:00
|
|
|
EXPOSE 80 443
|
2021-04-10 08:21:07 +00:00
|
|
|
|
2021-04-22 09:01:45 +00:00
|
|
|
CMD ["/opt/run.sh"]
|