Skip to content

Commit

Permalink
fix: 🐛 entrypoint wasn't setting user permissions for processes
Browse files Browse the repository at this point in the history
  • Loading branch information
djdembeck committed Apr 18, 2023
1 parent 71d8f9a commit b3bd8a7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,29 @@ echo "Starting with UID: $USER_ID, GID: $GROUP_ID"
# Fix permissions
chown -R "$USER_ID":"$GROUP_ID" /config /input /output

# Run the command as the specified user
gosu "$USER_ID":"$GROUP_ID" "$@"

until cd /home/app/web
do
echo "Waiting for server volume..."
sleep 1
done


until python manage.py migrate
until gosu "$USER_ID":"$GROUP_ID" python manage.py migrate
do
echo "Waiting for db to be ready..."
sleep 2
done

python manage.py collectstatic --noinput
gosu "$USER_ID":"$GROUP_ID"python manage.py collectstatic --noinput

# Start Celery Worker
celery -A bragibooks_proj worker --loglevel=info --concurrency 1 -E &
gosu "$USER_ID":"$GROUP_ID" celery -A bragibooks_proj worker --loglevel=info --concurrency 1 -E &

# If you want to use the admin panel for debugging
# python manage.py createsuperuser --noinput

# Start gunicorn server
gunicorn bragibooks_proj.wsgi \
gosu "$USER_ID":"$GROUP_ID" gunicorn bragibooks_proj.wsgi \
--bind 0.0.0.0:8000 \
--timeout 1200 \
--worker-tmp-dir /dev/shm \
Expand Down

0 comments on commit b3bd8a7

Please sign in to comment.