Commit
·
2f6d9ae
1
Parent(s):
404950f
disable redis persistence for hugging face deployment
Browse files- startup.sh +24 -5
startup.sh
CHANGED
|
@@ -1,13 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
# Start the Redis server in the background
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
# Start the Celery worker in the background
|
| 7 |
-
# We point it to the app folder where the code lives
|
| 8 |
celery -A celery_worker.celery worker --loglevel=info &
|
| 9 |
|
|
|
|
|
|
|
| 10 |
# Start the FastAPI server in the foreground
|
| 11 |
-
# This
|
| 12 |
-
|
| 13 |
uvicorn main:app --host 0.0.0.0 --port 7860
|
|
|
|
| 1 |
+
# #!/bin/bash
|
| 2 |
+
|
| 3 |
+
# # Start the Redis server in the background
|
| 4 |
+
# redis-server --daemonize yes
|
| 5 |
+
|
| 6 |
+
# # Start the Celery worker in the background
|
| 7 |
+
# # We point it to the app folder where the code lives
|
| 8 |
+
# celery -A celery_worker.celery worker --loglevel=info &
|
| 9 |
+
|
| 10 |
+
# # Start the FastAPI server in the foreground
|
| 11 |
+
# # This is the main process that keeps the container alive
|
| 12 |
+
# # It must listen on 0.0.0.0 and port 7860 for Hugging Face Spaces
|
| 13 |
+
# uvicorn main:app --host 0.0.0.0 --port 7860
|
| 14 |
+
|
| 15 |
+
|
| 16 |
#!/bin/bash
|
| 17 |
|
| 18 |
+
# Start the Redis server in the background WITH PERSISTENCE DISABLED
|
| 19 |
+
# The '--save ""' command tells Redis not to create any RDB snapshots.
|
| 20 |
+
redis-server --daemonize yes --save "" --appendonly no
|
| 21 |
+
|
| 22 |
+
echo "Redis started with persistence disabled."
|
| 23 |
|
| 24 |
# Start the Celery worker in the background
|
|
|
|
| 25 |
celery -A celery_worker.celery worker --loglevel=info &
|
| 26 |
|
| 27 |
+
echo "Celery worker started."
|
| 28 |
+
|
| 29 |
# Start the FastAPI server in the foreground
|
| 30 |
+
# This keeps the container alive.
|
| 31 |
+
echo "Starting FastAPI server..."
|
| 32 |
uvicorn main:app --host 0.0.0.0 --port 7860
|