Skip to content

Commit 3dbdc15

Browse files
committed
Switch to nginx-stable release, turn off cache during build
1 parent e04e555 commit 3dbdc15

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

docker/docker-development.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ else
106106
cp ../VERSION entity-api
107107
cp ../BUILD entity-api
108108

109-
docker compose -f docker-compose.yml -f docker-compose.development.yml -p entity-api build
109+
docker compose -f docker-compose.yml -f docker-compose.development.yml -p entity-api build --no-cache
110110
elif [ "$1" = "start" ]; then
111111
docker compose -f docker-compose.yml -f docker-compose.development.yml -p entity-api up -d
112112
elif [ "$1" = "stop" ]; then

docker/entity-api/Dockerfile

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ WORKDIR /usr/src/app
1313
# Copy from host to image
1414
COPY . .
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.)
1818
RUN 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/
2323
gpgcheck=1
24-
enabled=0
24+
enabled=1
2525
gpgkey=https://nginx.org/keys/nginx_signing.key
2626
module_hotfixes=true
2727
EOF
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
@@ -37,9 +37,7 @@ EOF
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 && \
@@ -53,7 +51,7 @@ EOF
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.
7270
RUN 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

7573
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
7674

0 commit comments

Comments
 (0)