d2ray/Dockerfile

32 lines
819 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
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 08:21:07 +00:00
apk del unzip wget
COPY ./nginx.conf /opt/nginx.conf
COPY ./crontab /var/spool/cron/crontabs/root
EXPOSE 80
EXPOSE 443
CMD ["/opt/run.sh"]