From f15914321f6318d4c599bc804a7e6689e68fbf2b Mon Sep 17 00:00:00 2001 From: Drini Cami Date: Mon, 16 Dec 2024 16:35:13 -0500 Subject: [PATCH] fixup! Use newer version of NJS --- docker/Dockerfile.olbase | 18 ++---------------- scripts/install_nginx.sh | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 16 deletions(-) create mode 100755 scripts/install_nginx.sh diff --git a/docker/Dockerfile.olbase b/docker/Dockerfile.olbase index 982dceae596..2d2be3fb2e3 100644 --- a/docker/Dockerfile.olbase +++ b/docker/Dockerfile.olbase @@ -40,22 +40,8 @@ RUN ./install_nodejs.sh && rm ./install_nodejs.sh # Install nginx USER root -RUN apt-get update \ - && apt-get install -y --no-install-recommends curl \ - # log rotation service for ol-nginx - logrotate \ - # rsync service for pulling monthly sitemaps from ol-home0 to ol-www0 - rsync \ - # Add the NGINX signing key - && curl -fsSL https://nginx.org/keys/nginx_signing.key | tee /usr/share/keyrings/nginx-keyring.asc \ - # Add the NGINX repository for Debian - && echo "deb [signed-by=/usr/share/keyrings/nginx-keyring.asc] http://nginx.org/packages/debian $(lsb_release -cs) nginx" \ - > /etc/apt/sources.list.d/nginx.list \ - && apt-get update \ - # Install nginx and the NJS module - && apt-get install -y --no-install-recommends nginx nginx-module-njs letsencrypt \ - # Remove the stock nginx config file - && rm /etc/nginx/sites-enabled/default +COPY scripts/install_nginx.sh ./ +RUN ./install_nginx.sh && rm ./install_nginx.sh RUN mkdir -p /var/log/openlibrary /var/lib/openlibrary && chown openlibrary:openlibrary /var/log/openlibrary /var/lib/openlibrary \ && mkdir /openlibrary && chown openlibrary:openlibrary /openlibrary \ diff --git a/scripts/install_nginx.sh b/scripts/install_nginx.sh new file mode 100755 index 00000000000..5328d6d21b4 --- /dev/null +++ b/scripts/install_nginx.sh @@ -0,0 +1,21 @@ +#! /bin/bash + +apt-get update + +# log rotation service for ol-nginx +# rsync service for pulling monthly sitemaps from ol-home0 to ol-www0 +apt-get install -y --no-install-recommends curl \ + logrotate \ + rsync + +# Add the NGINX signing key + Repo +curl -fsSL https://nginx.org/keys/nginx_signing.key | tee /usr/share/keyrings/nginx-keyring.asc +echo "deb [signed-by=/usr/share/keyrings/nginx-keyring.asc] http://nginx.org/packages/debian $(lsb_release -cs) nginx" \ + > /etc/apt/sources.list.d/nginx.list + +# Install nginx and the NJS module +apt-get update +apt-get install -y --no-install-recommends nginx nginx-module-njs letsencrypt + +# Remove the stock nginx config file +rm /etc/nginx/sites-enabled/default \ No newline at end of file