Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.DS_Store
.DS_Store

# Download file is now generated at build time via Dockerfile
files/www/downloading
30 changes: 21 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ ENV HTTP_PORT=3000
ENV HTTPS_PORT=3001
ENV SET_USER=101

# Build arguments for generating download file at build time
ARG FILE_SIZE=31457280
ARG FILE_NAME=downloading

COPY /files/OpenSpeedTest-Server.conf ${CONFIG}
COPY /files/entrypoint.sh /entrypoint.sh
COPY /files/renew.sh /renew.sh
Expand All @@ -28,15 +32,23 @@ COPY /files/nginx.key /etc/ssl/

USER root
VOLUME /var/log/letsencrypt

# Generate random download file at build time (30MB by default)
# This reduces repository size and ensures unique test data per build
RUN apk add --no-cache --virtual .build-deps coreutils && \
dd if=/dev/urandom of=/usr/share/nginx/html/$FILE_NAME bs=1 count=$FILE_SIZE && \
apk del .build-deps && \
rm -rf /var/cache/apk/*

RUN rm -rf /etc/nginx/conf.d/default.conf \
&& chown -R nginx /usr/share/nginx/html/ \
&& chmod 755 /usr/share/nginx/html/downloading \
&& chmod 755 /usr/share/nginx/html/upload \
&& chown nginx ${CONFIG} \
&& chmod 400 ${CONFIG} \
&& chown nginx /etc/nginx/nginx.conf \
&& chmod 400 /etc/nginx/nginx.conf \
&& chmod +x /entrypoint.sh \
&& chown -R nginx /usr/share/nginx/html/ \
&& chmod 755 /usr/share/nginx/html/$FILE_NAME \
&& chmod 755 /usr/share/nginx/html/upload \
&& chown nginx ${CONFIG} \
&& chmod 400 ${CONFIG} \
&& chown nginx /etc/nginx/nginx.conf \
&& chmod 400 /etc/nginx/nginx.conf \
&& chmod +x /entrypoint.sh \
&& chmod +x /renew.sh


Expand All @@ -56,7 +68,7 @@ RUN mkdir -p /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
Expand Down
Binary file removed files/www/downloading
Binary file not shown.