d2ray/Dockerfile

28 lines
642 B
Docker
Raw Normal View History

2021-04-10 08:21:07 +00:00
FROM alpine:latest
2021-04-23 06:51:06 +00:00
COPY image/ /opt/
2021-04-10 08:21:07 +00:00
2021-04-23 06:51:06 +00:00
# install packages
RUN set -xe && apk add --no-cache unzip wget nginx certbot openssl
# setup core files
RUN set -xe && mkdir -p /opt/xray && \
2021-04-10 09:47:21 +00:00
ln -s /opt/config/certs /etc/letsencrypt && \
2021-04-23 06:51:06 +00:00
unzip /opt/Xray-linux-64.zip -d /opt/xray && \
rm /opt/Xray-linux-64.zip && \
chmod +x /opt/run.sh /opt/crypt.sh
# crond
RUN set -xe && mv /opt/crontab /var/spool/cron/crontabs/root
# nginx
RUN set -xe && addgroup www && \
2021-04-10 10:36:23 +00:00
adduser -H -D -S -s /bin/false www -G www && \
2021-04-23 06:51:06 +00:00
chown -R www:www /opt/nginx
# remove packages
RUN set -xe && 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-23 06:51:06 +00:00
CMD ["/opt/run.sh"]