Skip to content

Commit

Permalink
We were getting some spurious failures connecting to redis on initial…
Browse files Browse the repository at this point in the history
… bring-up

The problem was recovered automatically, but it still was producing events for sentry.io.
  • Loading branch information
scanner committed Oct 26, 2023
1 parent 7a01864 commit a79f0c4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/scripts/start_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set -o errexit
set -o pipefail
set -o nounset

wait-for-it --service redis:6379 -- echo "Redis available"
# XXX We collectstatic in the docker image build step so we should probably
# remove this.
/venv/bin/python /app/manage.py collectstatic --clear --no-input --verbosity 0
/venv/bin/python /app/manage.py migrate
/venv/bin/gunicorn config.asgi --bind 0.0.0.0:8000 --chdir=/app -w 4 -k uvicorn.workers.UvicornWorker
2 changes: 2 additions & 0 deletions app/scripts/start_smtpd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -o errexit
set -o pipefail
set -o nounset

wait-for-it --service redis:6379 -- echo "Redis available"

echo "Running django migrations.."
/venv/bin/python /app/manage.py migrate

Expand Down
1 change: 1 addition & 0 deletions app/scripts/start_worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ set -o errexit
set -o pipefail
set -o nounset

wait-for-it --service redis:6379 -- echo "Redis available"
/venv/bin/python /app/manage.py migrate
/venv/bin/python /app/manage.py run_huey
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ services:
- mailhog
ports:
- "11578:8000"
command: /app/manage.py runserver_plus --cert-file /mnt/ssl/ssl_crt.pem --key-file /mnt/ssl/ssl_key.pem 0.0.0.0:8000
command: wait-for-it --service redis:6379 -- /app/manage.py runserver_plus --cert-file /mnt/ssl/ssl_crt.pem --key-file /mnt/ssl/ssl_key.pem 0.0.0.0:8000
restart: always
env_file: .env
volumes:
Expand Down

0 comments on commit a79f0c4

Please sign in to comment.