Skip to content

Commit 4c4f1ff

Browse files
author
Emil
authored
Merge pull request #35 from unicef/fix/media-folder
Fix media & static folders setup
2 parents fca12e6 + 9cb258b commit 4c4f1ff

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docker/bin/docker-entrypoint.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ export MEDIA_ROOT="${MEDIA_ROOT:-/var/run/app/media}"
55
export STATIC_ROOT="${STATIC_ROOT:-/var/run/app/static}"
66
export UWSGI_PROCESSES="${UWSGI_PROCESSES:-"4"}"
77
export DJANGO_SETTINGS_MODULE="country_workspace.config.settings"
8+
mkdir -p "${MEDIA_ROOT}" "${STATIC_ROOT}" || echo "Cannot create dirs ${MEDIA_ROOT} ${STATIC_ROOT}"
9+
10+
if [ -d "${MEDIA_ROOT}" ];then
11+
chown -R hope:unicef ${MEDIA_ROOT}
12+
fi
13+
14+
if [ -d "${STATIC_ROOT}" ];then
15+
chown -R hope:unicef ${STATIC_ROOT}
16+
fi
817

918
mkdir -p /app/
1019
chown -R hope:unicef /app

0 commit comments

Comments
 (0)