2020-12-13 05:13:30 +00:00
|
|
|
#!/usr/bin/with-contenv bash
|
|
|
|
|
|
|
|
# Change runtime user UID and GID
|
|
|
|
PUID=${PUID:-911}
|
|
|
|
PGID=${PGID:-911}
|
|
|
|
groupmod -o -g "$PGID" app
|
|
|
|
usermod -o -u "$PUID" app
|
|
|
|
|
|
|
|
# Reset permissions
|
|
|
|
chown -R app:app /run/app && \
|
|
|
|
chmod -R 0700 /run/app && \
|
|
|
|
chown -R app:app /config && \
|
|
|
|
chmod -R 0755 /config && \
|
|
|
|
chown -R app:app /downloads && \
|
|
|
|
chmod -R 0755 /downloads && \
|
|
|
|
chown -R root:app /app && \
|
|
|
|
chmod -R 0750 /app && \
|
2020-12-13 11:43:06 +00:00
|
|
|
chown -R app:app /app/common/static && \
|
|
|
|
chmod -R 0750 /app/common/static && \
|
2020-12-13 11:52:50 +00:00
|
|
|
chown -R app:app /app/static && \
|
|
|
|
chmod -R 0750 /app/static && \
|
2020-12-13 05:13:30 +00:00
|
|
|
find /app -type f -exec chmod 640 {} \; && \
|
2020-12-17 08:23:32 +00:00
|
|
|
chmod +x /app/healthcheck.py
|
2020-12-13 05:13:30 +00:00
|
|
|
|
|
|
|
# Run migrations
|
|
|
|
exec s6-setuidgid app \
|
|
|
|
/usr/bin/python3 /app/manage.py migrate
|