@@ -13,22 +13,22 @@ WORKDIR /usr/src/app
1313# Copy from host to image
1414COPY . .
1515
16- # Set up the repository file for the mainline version of
16+ # Set up the repository file for the stable version of
1717# nginx which dnf should use (in the legacy "yum" location.)
1818RUN set -eux && \
1919 cat <<'EOF' > /etc/yum.repos.d/nginx.repo
20- [nginx-mainline ]
21- name=nginx mainline repo
22- baseurl=http://nginx.org/packages/mainline/ centos/$releasever/$basearch/
20+ [nginx-stable ]
21+ name=nginx stable repo
22+ baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
2323gpgcheck=1
24- enabled=0
24+ enabled=1
2525gpgkey=https://nginx.org/keys/nginx_signing.key
2626module_hotfixes=true
2727EOF
2828
2929# Reduce the number of layers in image by minimizing the number of separate RUN commands
3030# 1 - Install the prerequisites
31- # 2 - By default, the repository for stable nginx packages is used. We would like to use mainline nginx packages
31+ # 2 - By default, the repository for stable nginx packages is used.
3232# 3 - Install nginx (using the custom dnf/yum repo specified earlier)
3333# 4 - Remove the default nginx config file
3434# 5 - Overwrite the nginx.conf with ours to run nginx as non-root
3737# 8 - Make the start script executable
3838# 9 - Clean the dnf/yum cache and other locations to reduce Docker Image layer size.
3939# Assume the base image has upgraded dnf and installed its dnf-plugins-core
40- RUN dnf install --assumeyes dnf-plugins-core && \
41- dnf config-manager --enable nginx-mainline && \
42- dnf install --assumeyes nginx && \
40+ RUN dnf install --assumeyes nginx && \
4341 # Push aside nginx default.conf files that may exist on the system
4442 [ ! -f /etc/nginx/conf.d/default.conf ] || mv /etc/nginx/conf.d/default.conf /tmp/etc_nginx_conf.d_default.conf.ORIGINAL && \
4543 [ ! -f /etc/nginx/nginx.conf ] || mv /etc/nginx/nginx.conf /tmp/etc_nginx_nginx.conf.ORIGINAL && \
5351 # Install the requirements.txt file for the service
5452 pip3.13 install --no-cache-dir --upgrade pip -r src/requirements.txt && \
5553 # Make the script referenced in the CMD directive below executable.
56- chmod 755 start.sh && \
54+ chmod a+x start.sh && \
5755 # Clean up artifacts to slim down this layer of the Docker Image
5856 dnf clean all && \
5957 rm -rf /var/cache/dnf \
@@ -70,7 +68,7 @@ EXPOSE 5000 8080
7068# the location referenced by the ENTRYPOINT directive below, and
7169# make it executable.
7270RUN mv entrypoint.sh /usr/local/bin/entrypoint.sh && \
73- chmod 755 /usr/local/bin/entrypoint.sh
71+ chmod a+x /usr/local/bin/entrypoint.sh
7472
7573ENTRYPOINT ["/usr/local/bin/entrypoint.sh" ]
7674
0 commit comments