Skip to content

Commit

Permalink
V2
Browse files Browse the repository at this point in the history
  • Loading branch information
openspeedtest committed Jun 22, 2023
1 parent 557df53 commit 06a2d92
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 14 deletions.
36 changes: 31 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ FROM nginxinc/nginx-unprivileged:stable-alpine

LABEL maintainer "OpenSpeedTest.com <support@OpenSpeedTest.com>"

<<<<<<< HEAD
ENV ENABLE_LETSENCRYPT=false
ENV DOMAIN_NAME=false
ENV USER_EMAIL=false
=======
>>>>>>> main
ENV CONFIG=/etc/nginx/conf.d/OpenSpeedTest-Server.conf

COPY /files/OpenSpeedTest-Server.conf ${CONFIG}
COPY /files/entrypoint.sh /entrypoint.sh
COPY /files/renew.sh /renew.sh
RUN rm /etc/nginx/nginx.conf
COPY /files/nginx.conf /etc/nginx/
COPY /files/www/ /usr/share/nginx/html/
Expand All @@ -23,7 +21,7 @@ COPY /files/nginx.key /etc/ssl/


USER root

VOLUME /var/log/letsencrypt
RUN rm -rf /etc/nginx/conf.d/default.conf \
&& chown -R nginx /usr/share/nginx/html/ \
&& chmod 755 /usr/share/nginx/html/downloading \
Expand All @@ -32,10 +30,37 @@ RUN rm -rf /etc/nginx/conf.d/default.conf \
&& chmod 400 ${CONFIG} \
&& chown nginx /etc/nginx/nginx.conf \
&& chmod 400 /etc/nginx/nginx.conf \
&& chmod +x /entrypoint.sh
&& chmod +x /entrypoint.sh \
&& chmod +x /renew.sh



RUN mkdir -p /etc/letsencrypt && \
chown -R nginx /etc/letsencrypt && \
chmod 775 /etc/letsencrypt

RUN mkdir -p /var/lib/letsencrypt && \
chown -R nginx /var/lib/letsencrypt && \
chmod 775 /var/lib/letsencrypt

RUN mkdir -p /var/log/letsencrypt && \
chown -R nginx /var/log/letsencrypt && \
chmod 775 /var/log/letsencrypt

RUN mkdir -p /usr/share/nginx/html/.well-known/acme-challenge && \
chown -R nginx /usr/share/nginx/html/.well-known/acme-challenge && \
chmod 775 /usr/share/nginx/html/.well-known/acme-challenge

RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
RUN update-ca-certificates
RUN apk add --no-cache certbot certbot-nginx
RUN apk update && apk add --no-cache dcron libcap

RUN chown nginx:nginx /usr/sbin/crond \
&& setcap cap_setgid=ep /usr/sbin/crond

RUN touch /etc/crontabs/nginx
RUN chown -R nginx:nginx /etc/crontabs/nginx

USER 101

Expand All @@ -44,3 +69,4 @@ EXPOSE 3000 3001
STOPSIGNAL SIGQUIT

CMD ["/entrypoint.sh"]

5 changes: 1 addition & 4 deletions files/OpenSpeedTest-Server.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Developed by : Vishnu | https://Vishnu.Pro | Email : me@vishnu.pro

server {
server_name _ localhost;
server_name _ localhost YOURDOMAIN;
listen 3000;
listen 3001 ssl;
listen [::]:3000;
Expand Down Expand Up @@ -39,7 +39,6 @@ server_name _ localhost;
open_file_cache_min_uses 2;
open_file_cache_errors off;

<<<<<<< HEAD
location ~ /\.well-known/acme-challenge/ {
allow all;
default_type "text/plain";
Expand All @@ -48,8 +47,6 @@ server_name _ localhost;
break;
}

=======
>>>>>>> main
location / {

add_header 'Access-Control-Allow-Origin' "*" always;
Expand Down
6 changes: 1 addition & 5 deletions files/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ if [[ $? -ne 0 ]]; then
sed -i '/listen 300/d' ${CONFIG}
fi

<<<<<<< HEAD
Verify_TXT_path="/usr/share/nginx/html/Verify.txt"

if [ "$VERIFY_OWNERSHIP" ]; then
Expand Down Expand Up @@ -119,7 +118,4 @@ fi

crond -b -l 5

tail -f /dev/null
=======
exec nginx -g 'daemon off;'
>>>>>>> main
tail -f /dev/null

0 comments on commit 06a2d92

Please sign in to comment.