From 46e1b3e57d15f469a1485fc311c289afce8fe13e Mon Sep 17 00:00:00 2001 From: RyanSquared Date: Sat, 5 Aug 2023 13:03:10 -0500 Subject: [PATCH 1/2] Dockerfile, nginx.conf: add configuration for vcard file type --- Dockerfile | 1 + nginx.conf | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile index 1d65238..948c5e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,3 +12,4 @@ RUN jekyll build FROM nginx COPY --from=builder /home/_site /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..cdb54d7 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,21 @@ +# vim:set et sw=4 ts=4: + +server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + location ~* \.vcf$ { + default_type text/vcard; + root /usr/share/nginx/html; + } +} From 70ca5462ee7d199ba61e5729dc71702d29e75675 Mon Sep 17 00:00:00 2001 From: RyanSquared Date: Sat, 5 Aug 2023 15:23:40 -0500 Subject: [PATCH 2/2] Dockerfile, -nginx.conf: regenerate nginx mime types using Debian media-types package --- Dockerfile | 9 ++++++++- nginx.conf | 21 --------------------- 2 files changed, 8 insertions(+), 22 deletions(-) delete mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile index 948c5e5..2749dfa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,13 @@ RUN bundle install COPY . /home RUN jekyll build +FROM debian:bookworm AS mime-types +RUN apt-get update && apt-get install -y media-types + +RUN echo 'types {' > /tmp/mime.types +RUN sed -e '/^$/d' -e 's/$/;/' /etc/mime.types >> /tmp/mime.types +RUN echo '}' >> /tmp/mime.types + FROM nginx COPY --from=builder /home/_site /usr/share/nginx/html -COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=mime-types /tmp/mime.types /etc/nginx/mime.types diff --git a/nginx.conf b/nginx.conf deleted file mode 100644 index cdb54d7..0000000 --- a/nginx.conf +++ /dev/null @@ -1,21 +0,0 @@ -# vim:set et sw=4 ts=4: - -server { - listen 80; - server_name localhost; - - location / { - root /usr/share/nginx/html; - index index.html index.htm; - } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } - - location ~* \.vcf$ { - default_type text/vcard; - root /usr/share/nginx/html; - } -}