Spaces:
Runtime error
Runtime error
Usman Bari commited on
Commit ·
f02148f
1
Parent(s): 0c6bee4
Add Dockerfile for Hugging Face Spaces deployment
Browse files- Dockerfile +22 -0
Dockerfile
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10
|
| 2 |
+
|
| 3 |
+
# Set working directory
|
| 4 |
+
WORKDIR /code
|
| 5 |
+
|
| 6 |
+
# Copy requirements
|
| 7 |
+
COPY ./backend/requirements.txt /code/requirements.txt
|
| 8 |
+
|
| 9 |
+
# Install dependencies
|
| 10 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 11 |
+
|
| 12 |
+
# Create necessary directories
|
| 13 |
+
RUN mkdir -p /code/databases/csv /code/databases/schema /code/sample_data
|
| 14 |
+
|
| 15 |
+
# Copy the entire project
|
| 16 |
+
COPY . /code/
|
| 17 |
+
|
| 18 |
+
# Hugging Face Spaces run on port 7860 by default
|
| 19 |
+
ENV PORT=7860
|
| 20 |
+
|
| 21 |
+
# Run the FastAPI app with Uvicorn
|
| 22 |
+
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"]
|