diff --git a/app/Dockerfile b/app/Dockerfile index 8536738..5869e3a 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -22,8 +22,12 @@ RUN pip install --upgrade pip && \ COPY . $APP_HOME RUN sed -i 's/\r$//g' $APP_HOME/entrypoint.sh && \ + chown -R app:app $APP_HOME && \ chmod +x $APP_HOME/entrypoint.sh && \ - chown -R app:app $APP_HOME + chown root:root $APP_HOME/fix_permissions.sh && \ + chmod +x $APP_HOME/fix_permissions.sh && \ + chmod u+s $APP_HOME/fix_permissions.sh + USER app diff --git a/app/entrypoint.sh b/app/entrypoint.sh index 5c0ac55..266951d 100644 --- a/app/entrypoint.sh +++ b/app/entrypoint.sh @@ -2,8 +2,6 @@ python wait_for_db.py #chown -R app:app $APP_HOME -chown app:app $APP_HOME/media -chown app:app $APP_HOME/static python manage.py makemigrations python manage.py migrate python manage.py collectstatic --noinput diff --git a/app/fix_permissions.sh b/app/fix_permissions.sh new file mode 100644 index 0000000..02043e8 --- /dev/null +++ b/app/fix_permissions.sh @@ -0,0 +1,3 @@ +#!/bin/sh +chown app:app $APP_HOME/media +chown app:app $APP_HOME/static \ No newline at end of file