Fix for permissions

This commit is contained in:
Walter 2025-02-21 01:48:03 +01:00
parent 8277bad474
commit 4ab2009720
3 changed files with 8 additions and 3 deletions

View File

@ -22,8 +22,12 @@ RUN pip install --upgrade pip && \
COPY . $APP_HOME COPY . $APP_HOME
RUN sed -i 's/\r$//g' $APP_HOME/entrypoint.sh && \ RUN sed -i 's/\r$//g' $APP_HOME/entrypoint.sh && \
chown -R app:app $APP_HOME && \
chmod +x $APP_HOME/entrypoint.sh && \ 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 USER app

View File

@ -2,8 +2,6 @@
python wait_for_db.py python wait_for_db.py
#chown -R app:app $APP_HOME #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 makemigrations
python manage.py migrate python manage.py migrate
python manage.py collectstatic --noinput python manage.py collectstatic --noinput

3
app/fix_permissions.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
chown app:app $APP_HOME/media
chown app:app $APP_HOME/static