From 1e772a7d316abc296fc76e16847db731762e2102 Mon Sep 17 00:00:00 2001
From: Loxbie <ole@freirad.at>
Date: Tue, 20 Feb 2024 12:37:22 +0100
Subject: [PATCH] Fix: create the /app/site_media directory in advance

/app/site_media is mapped to a named volume when deploying with docker compose as part of AURA Playout. Docker creates the directory as root where a named volume should be mapped to if it does not already exist. We therefore create the mount point in advance and set permissions in order to give the aura(app) user access. #184
---
 Dockerfile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Dockerfile b/Dockerfile
index 34714ff5..89c78516 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -33,7 +33,13 @@ COPY . .
 
 RUN adduser --home /app --no-create-home --system --uid ${AURA_UID} --group app
 RUN mkdir -p /app/logs
+# static/admin and site_media are named volumes which we use across multiple
+# containers. We therefore create them here and set the permissions right away
+# since named volumes otherwise create these directories themself as the root 
+# user.
 RUN mkdir -p /app/static/admin
+RUN mkdir -p /app/site_media
+# set permissions
 RUN chown -R app:app /app
 
 USER app
-- 
GitLab