d2ray/Dockerfile

35 lines
958 B
Docker
Raw Normal View History

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
COPY ./run.sh /opt/run.sh
2021-04-10 10:31:32 +00:00
COPY ./nginx /opt/nginx
COPY ./nginx.conf /opt/nginx.conf
COPY ./crontab /var/spool/cron/crontabs/root
2021-04-10 08:21:07 +00:00
RUN set -xe && \
2021-04-10 09:40:04 +00:00
chmod +x /opt/run.sh && \
2021-04-10 08:21:07 +00:00
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-10 09:40:04 +00:00
apk add --no-cache unzip wget nginx certbot openssl && \
wget ${URL} && \
unzip Xray-linux-64.zip -d /opt/xray && \
rm Xray-linux-64.zip && \
2021-04-10 10:31:32 +00:00
apk del unzip wget && \
2021-04-10 10:36:23 +00:00
addgroup www && \
adduser -H -D -S -s /bin/false www -G www && \
2021-04-10 10:37:01 +00:00
chown -R www:www /opt/nginx /opt/nginx.conf
2021-04-10 10:31:32 +00:00
2021-04-10 08:21:07 +00:00
2021-04-10 10:31:32 +00:00
EXPOSE 80,443
2021-04-10 08:21:07 +00:00
CMD ["/opt/run.sh"]