d2ray/Dockerfile

35 lines
1.0 KiB
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
2021-04-19 07:51:22 +00:00
COPY image/run.sh /opt/run.sh
COPY image/nginx.conf /opt/nginx.conf
COPY image/crontab /var/spool/cron/crontabs/root
COPY image/wait_for_it.sh /opt/wait_for_it.sh
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-19 07:58:16 +00:00
apk add --no-cache unzip wget nginx certbot bash && \
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: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-19 07:52:41 +00:00
chown -R www:www /opt/nginx.conf && \
2021-04-19 07:51:22 +00:00
chmod +x /opt/run.sh /opt/wait_for_it.sh
2021-04-10 10:31:32 +00:00
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-19 08:21:20 +00:00
CMD ["/opt/wait_for_it.sh", "d2ray_nextcloud:80", "--", "sh", "/opt/run.sh"]