File size: 837 Bytes
a0a1efe
 
 
185c8ab
 
 
a0a1efe
 
 
 
 
 
185c8ab
a0a1efe
 
185c8ab
a0a1efe
 
185c8ab
 
 
 
a0a1efe
 
185c8ab
 
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
#!/bin/bash
set -e

# Start Redis server in the background with RDB snapshots disabled
echo "Starting Redis server with RDB snapshots disabled..."
redis-server --save "" --daemonize yes

# Wait for Redis to be ready
until redis-cli ping; do
  echo "Waiting for Redis to be ready..."
  sleep 1
done
echo "Redis is ready."

# Start Celery worker in the background
echo "Starting Celery worker..."
celery -A celery_worker.celery worker --pool=solo -l info &

# Wait for Celery to initialize (optional, can be adjusted or removed if not strictly necessary)
echo "Waiting for Celery to initialize..."
sleep 2 # Adjusted sleep time, consider if still needed
echo "Celery worker started."

# Start Flask application with Waitress
echo "Starting Flask application with Waitress on $HOST:$PORT..."
waitress-serve --host=$HOST --port=$PORT app:app