forked from psinghal01/tripsync-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
29 lines (23 loc) · 826 Bytes
/
Copy pathentrypoint.sh
File metadata and controls
29 lines (23 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
set -e
echo "Waiting for PostgreSQL at ${DB_HOST}:${DB_PORT}..."
until nc -z "${DB_HOST}" "${DB_PORT}"; do sleep 1; done
echo "PostgreSQL is ready."
echo "Waiting for Redis at ${REDIS_HOST}:${REDIS_PORT}..."
until nc -z "${REDIS_HOST}" "${REDIS_PORT}"; do sleep 1; done
echo "Redis is ready."
echo "Waiting for RabbitMQ at ${RABBITMQ_HOST}:${RABBITMQ_PORT:-5672}..."
until nc -z "${RABBITMQ_HOST}" "${RABBITMQ_PORT:-5672}"; do sleep 1; done
echo "RabbitMQ is ready."
echo "Running database migrations..."
python manage.py migrate --noinput
echo "Collecting static files..."
python manage.py collectstatic --noinput --clear
echo "Starting Gunicorn..."
exec gunicorn main.wsgi:application \
--bind 0.0.0.0:8000 \
--workers 4 \
--timeout 120 \
--access-logfile - \
--error-logfile - \
--log-level info