From 5f07c685add7a81195fbd103f9b9b4e98612abed Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Thu, 7 Jan 2021 06:59:53 -0700 Subject: [PATCH] feature(DOCKERFILE): add nano, stop using git - add nano and nano configuration file - download and untar errorpages instead of installing git --- build/Dockerfile | 14 +-- build/nanorc | 273 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 280 insertions(+), 7 deletions(-) create mode 100644 build/nanorc diff --git a/build/Dockerfile b/build/Dockerfile index ed2d01b..c35eaa2 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -15,15 +15,14 @@ RUN addgroup --gid ${UID} ${USER} \ --uid ${UID} \ ${USER} -# add fun error pages & LetsEncrypt challenge directory outside webroot -RUN apk --no-cache add git \ +# add nano, fun error pages & LetsEncrypt challenge directory outside webroot +RUN apk --no-cache add nano \ && cd /usr/share/nginx \ && rm -rf html/* \ - && git clone https://git.asifbacchus.app/asif/fun-errorpages.git /tmp \ - && apk del git \ - && mv /tmp/errorpages/ ./ \ - && rm -rf /tmp/* \ - && rm -rf /tmp/.git* + && wget -O /tmp/errorpages.tar.gz https://git.asifbacchus.app/asif/fun-errorpages/archive/v1.0.tar.gz \ + && tar -xzf /tmp/errorpages.tar.gz -C /tmp \ + && mv /tmp/fun-errorpages/errorpages ./ \ + && rm -rf /tmp/* # health check HEALTHCHECK --interval=60s --timeout=5s --start-period=30s --retries=3 \ @@ -41,6 +40,7 @@ LABEL org.opencontainers.image.title="ab-nginx" LABEL org.opencontainers.image.description="NGINX-mainline-alpine with more logical file location layout and automatic SSL set up if certificates are provided." # copy configuration files +COPY nanorc /etc/nanorc COPY entrypoint.sh /entrypoint.sh COPY config /etc/nginx/ COPY sites /etc/nginx/sites/ diff --git a/build/nanorc b/build/nanorc new file mode 100644 index 0000000..250796d --- /dev/null +++ b/build/nanorc @@ -0,0 +1,273 @@ +## Sample initialization file for GNU nano. +## +## Please note that you must have configured nano with --enable-nanorc +## for this file to be read! Also note that this file should not be in +## DOS or Mac format, and that characters specially interpreted by the +## shell should not be escaped here. +## +## To make sure an option is disabled, use "unset