Update docker-entrypoint.sh
Browse files- docker-entrypoint.sh +11 -5
docker-entrypoint.sh
CHANGED
|
@@ -1,20 +1,26 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
set -e
|
| 3 |
|
| 4 |
-
# Start Redis server in the background
|
| 5 |
-
|
|
|
|
| 6 |
|
| 7 |
# Wait for Redis to be ready
|
| 8 |
until redis-cli ping; do
|
| 9 |
echo "Waiting for Redis to be ready..."
|
| 10 |
sleep 1
|
| 11 |
done
|
|
|
|
| 12 |
|
| 13 |
# Start Celery worker in the background
|
|
|
|
| 14 |
celery -A celery_worker.celery worker --pool=solo -l info &
|
| 15 |
|
| 16 |
-
# Wait for Celery to initialize
|
| 17 |
-
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# Start Flask application with Waitress
|
| 20 |
-
|
|
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
set -e
|
| 3 |
|
| 4 |
+
# Start Redis server in the background with RDB snapshots disabled
|
| 5 |
+
echo "Starting Redis server with RDB snapshots disabled..."
|
| 6 |
+
redis-server --save "" --daemonize yes
|
| 7 |
|
| 8 |
# Wait for Redis to be ready
|
| 9 |
until redis-cli ping; do
|
| 10 |
echo "Waiting for Redis to be ready..."
|
| 11 |
sleep 1
|
| 12 |
done
|
| 13 |
+
echo "Redis is ready."
|
| 14 |
|
| 15 |
# Start Celery worker in the background
|
| 16 |
+
echo "Starting Celery worker..."
|
| 17 |
celery -A celery_worker.celery worker --pool=solo -l info &
|
| 18 |
|
| 19 |
+
# Wait for Celery to initialize (optional, can be adjusted or removed if not strictly necessary)
|
| 20 |
+
echo "Waiting for Celery to initialize..."
|
| 21 |
+
sleep 2 # Adjusted sleep time, consider if still needed
|
| 22 |
+
echo "Celery worker started."
|
| 23 |
|
| 24 |
# Start Flask application with Waitress
|
| 25 |
+
echo "Starting Flask application with Waitress on $HOST:$PORT..."
|
| 26 |
+
waitress-serve --host=$HOST --port=$PORT app:app
|