Skip to content

Commit db37907

Browse files
Remove chmod command to entrypoint.d/ folder from Dockerfile
1 parent 90aacad commit db37907

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,17 @@ RUN set -ex && \
4848
mkdir -p /etc/nginx/user_conf.d && \
4949
chown www-data:www-data -R /var/www \
5050
&& \
51+
# Make sure there are no surprise config files inside the config folder.
52+
rm -f /etc/nginx/conf.d/*
53+
5154
# Copy in our "default" Nginx server configurations, which make sure that the
5255
# ACME challenge requests are correctly forwarded to certbot and then redirects
5356
# everything else to HTTPS.
54-
rm -f /etc/nginx/conf.d/*
5557
COPY nginx_conf.d/ /etc/nginx/conf.d/
5658

5759
# Copy in all our scripts and make them executable.
5860
COPY scripts/ /scripts
5961
RUN chmod +x -R /scripts && \
60-
chmod +x -R /docker-entrypoint.d && \
6162
# Make so that the parent's entrypoint script is properly triggered (issue #21).
6263
sed -ri '/^if \[ "\$1" = "nginx" -o "\$1" = "nginx-debug" \]; then$/,${s//if echo "$1" | grep -q "nginx"; then/;b};$q1' /docker-entrypoint.sh
6364

src/Dockerfile-alpine

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,19 @@ RUN set -ex && \
3939
# Create new directories and set correct permissions.
4040
mkdir -p /var/www/letsencrypt && \
4141
mkdir -p /etc/nginx/user_conf.d && \
42-
chown 82:82 -R /var/www && \
42+
chown 82:82 -R /var/www \
43+
&& \
44+
# Make sure there are no surprise config files inside the config folder.
45+
rm -f /etc/nginx/conf.d/*
46+
4347
# Copy in our "default" Nginx server configurations, which make sure that the
4448
# ACME challenge requests are correctly forwarded to certbot and then redirects
4549
# everything else to HTTPS.
46-
rm -f /etc/nginx/conf.d/*
4750
COPY nginx_conf.d/ /etc/nginx/conf.d/
4851

4952
# Copy in all our scripts and make them executable.
5053
COPY scripts/ /scripts
5154
RUN chmod +x -R /scripts && \
52-
chmod +x -R /docker-entrypoint.d && \
5355
# Make so that the parent's entrypoint script is properly triggered (issue #21).
5456
sed -ri '/^if \[ "\$1" = "nginx" -o "\$1" = "nginx-debug" \]; then$/,${s//if echo "$1" | grep -q "nginx"; then/;b};$q1' /docker-entrypoint.sh
5557

0 commit comments

Comments
 (0)