Spaces:
Running
Running
Anish-530 commited on
Commit ·
b61bb63
1
Parent(s): ef1f114
Switch to Hugging Face Spaces Docker deployment
Browse files- Dockerfile +23 -0
- backend/start.sh +1 -1
Dockerfile
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
+
|
| 3 |
+
# Install system dependencies for AI processing
|
| 4 |
+
RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6 && rm -rf /var/lib/apt/lists/*
|
| 5 |
+
|
| 6 |
+
WORKDIR /app
|
| 7 |
+
|
| 8 |
+
# Copy backend requirements
|
| 9 |
+
COPY backend/requirements.txt .
|
| 10 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
+
|
| 12 |
+
# Copy backend code
|
| 13 |
+
COPY backend /app/backend
|
| 14 |
+
WORKDIR /app/backend
|
| 15 |
+
|
| 16 |
+
# Set environment variables
|
| 17 |
+
ENV PYTHONUNBUFFERED=1
|
| 18 |
+
|
| 19 |
+
# Make script executable
|
| 20 |
+
RUN chmod +x start.sh
|
| 21 |
+
|
| 22 |
+
# Start both Celery and FastAPI
|
| 23 |
+
CMD ["bash", "start.sh"]
|
backend/start.sh
CHANGED
|
@@ -6,4 +6,4 @@ celery -A app.worker.celery_app worker --loglevel=info -P solo &
|
|
| 6 |
|
| 7 |
# Start the FastAPI server in the foreground
|
| 8 |
echo "Starting FastAPI server..."
|
| 9 |
-
uvicorn main:app --host 0.0.0.0 --port $PORT --forwarded-allow-ips='*' --proxy-headers
|
|
|
|
| 6 |
|
| 7 |
# Start the FastAPI server in the foreground
|
| 8 |
echo "Starting FastAPI server..."
|
| 9 |
+
uvicorn main:app --host 0.0.0.0 --port ${PORT:-7860} --forwarded-allow-ips='*' --proxy-headers
|