Skip to content

Commit 06a2d92

Browse files
committed
V2
1 parent 557df53 commit 06a2d92

File tree

3 files changed

+33
-14
lines changed

3 files changed

+33
-14
lines changed

Dockerfile

+31-5
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@ FROM nginxinc/nginx-unprivileged:stable-alpine
44

55
LABEL maintainer "OpenSpeedTest.com <[email protected]>"
66

7-
<<<<<<< HEAD
87
ENV ENABLE_LETSENCRYPT=false
98
ENV DOMAIN_NAME=false
109
ENV USER_EMAIL=false
11-
=======
12-
>>>>>>> main
1310
ENV CONFIG=/etc/nginx/conf.d/OpenSpeedTest-Server.conf
1411

1512
COPY /files/OpenSpeedTest-Server.conf ${CONFIG}
1613
COPY /files/entrypoint.sh /entrypoint.sh
14+
COPY /files/renew.sh /renew.sh
1715
RUN rm /etc/nginx/nginx.conf
1816
COPY /files/nginx.conf /etc/nginx/
1917
COPY /files/www/ /usr/share/nginx/html/
@@ -23,7 +21,7 @@ COPY /files/nginx.key /etc/ssl/
2321

2422

2523
USER root
26-
24+
VOLUME /var/log/letsencrypt
2725
RUN rm -rf /etc/nginx/conf.d/default.conf \
2826
&& chown -R nginx /usr/share/nginx/html/ \
2927
&& chmod 755 /usr/share/nginx/html/downloading \
@@ -32,10 +30,37 @@ RUN rm -rf /etc/nginx/conf.d/default.conf \
3230
&& chmod 400 ${CONFIG} \
3331
&& chown nginx /etc/nginx/nginx.conf \
3432
&& chmod 400 /etc/nginx/nginx.conf \
35-
&& chmod +x /entrypoint.sh
33+
&& chmod +x /entrypoint.sh \
34+
&& chmod +x /renew.sh
35+
36+
37+
38+
RUN mkdir -p /etc/letsencrypt && \
39+
chown -R nginx /etc/letsencrypt && \
40+
chmod 775 /etc/letsencrypt
41+
42+
RUN mkdir -p /var/lib/letsencrypt && \
43+
chown -R nginx /var/lib/letsencrypt && \
44+
chmod 775 /var/lib/letsencrypt
3645

46+
RUN mkdir -p /var/log/letsencrypt && \
47+
chown -R nginx /var/log/letsencrypt && \
48+
chmod 775 /var/log/letsencrypt
49+
50+
RUN mkdir -p /usr/share/nginx/html/.well-known/acme-challenge && \
51+
chown -R nginx /usr/share/nginx/html/.well-known/acme-challenge && \
52+
chmod 775 /usr/share/nginx/html/.well-known/acme-challenge
53+
3754
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
3855
RUN update-ca-certificates
56+
RUN apk add --no-cache certbot certbot-nginx
57+
RUN apk update && apk add --no-cache dcron libcap
58+
59+
RUN chown nginx:nginx /usr/sbin/crond \
60+
&& setcap cap_setgid=ep /usr/sbin/crond
61+
62+
RUN touch /etc/crontabs/nginx
63+
RUN chown -R nginx:nginx /etc/crontabs/nginx
3964

4065
USER 101
4166

@@ -44,3 +69,4 @@ EXPOSE 3000 3001
4469
STOPSIGNAL SIGQUIT
4570

4671
CMD ["/entrypoint.sh"]
72+

files/OpenSpeedTest-Server.conf

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Developed by : Vishnu | https://Vishnu.Pro | Email : [email protected]
77

88
server {
9-
server_name _ localhost;
9+
server_name _ localhost YOURDOMAIN;
1010
listen 3000;
1111
listen 3001 ssl;
1212
listen [::]:3000;
@@ -39,7 +39,6 @@ server_name _ localhost;
3939
open_file_cache_min_uses 2;
4040
open_file_cache_errors off;
4141

42-
<<<<<<< HEAD
4342
location ~ /\.well-known/acme-challenge/ {
4443
allow all;
4544
default_type "text/plain";
@@ -48,8 +47,6 @@ server_name _ localhost;
4847
break;
4948
}
5049

51-
=======
52-
>>>>>>> main
5350
location / {
5451

5552
add_header 'Access-Control-Allow-Origin' "*" always;

files/entrypoint.sh

+1-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ if [[ $? -ne 0 ]]; then
1212
sed -i '/listen 300/d' ${CONFIG}
1313
fi
1414

15-
<<<<<<< HEAD
1615
Verify_TXT_path="/usr/share/nginx/html/Verify.txt"
1716

1817
if [ "$VERIFY_OWNERSHIP" ]; then
@@ -119,7 +118,4 @@ fi
119118

120119
crond -b -l 5
121120

122-
tail -f /dev/null
123-
=======
124-
exec nginx -g 'daemon off;'
125-
>>>>>>> main
121+
tail -f /dev/null

0 commit comments

Comments
 (0)