From 1fe401e2c279cfc29642c58bea5bac38696f1a15 Mon Sep 17 00:00:00 2001 From: Jonathan Green Date: Tue, 14 Jan 2025 11:31:37 -0400 Subject: [PATCH] Make sure docker webserver log files are created with correct permissions. --- docker/Dockerfile | 7 +------ docker/runit-web/nginx/run | 2 ++ docker/runit-web/uwsgi/run | 5 +++++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index f27446e50f..6234c34601 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -73,12 +73,7 @@ COPY docker/services/nginx /etc/nginx/ # Setup uwsgi COPY docker/services/uwsgi /etc/ -RUN mkdir -p /var/log/uwsgi && \ - chown root:adm /var/log/uwsgi && \ - touch /var/log/uwsgi/uwsgi.log && \ - chown simplified:adm /var/log/uwsgi/uwsgi.log && \ - chmod 644 /var/log/uwsgi/uwsgi.log && \ - mkdir /var/run/uwsgi && \ +RUN mkdir /var/run/uwsgi && \ chown simplified:simplified /var/run/uwsgi # Setup runit diff --git a/docker/runit-web/nginx/run b/docker/runit-web/nginx/run index 845c88d898..11fb77dd14 100755 --- a/docker/runit-web/nginx/run +++ b/docker/runit-web/nginx/run @@ -1,4 +1,6 @@ #!/bin/bash set -e +mkdir -p /var/log/nginx +chown root:adm /var/log/nginx exec /usr/sbin/nginx diff --git a/docker/runit-web/uwsgi/run b/docker/runit-web/uwsgi/run index df757e813a..49acc363f2 100755 --- a/docker/runit-web/uwsgi/run +++ b/docker/runit-web/uwsgi/run @@ -1,4 +1,9 @@ #!/bin/bash set -e +mkdir -p /var/log/uwsgi +chown root:adm /var/log/uwsgi +touch /var/log/uwsgi/uwsgi.log +chown simplified:adm /var/log/uwsgi/uwsgi.log +chmod 644 /var/log/uwsgi/uwsgi.log exec /var/www/circulation/env/bin/uwsgi --ini /etc/uwsgi.ini