Create Dockerfile
Browse filesAdded Dockerfile for deploying FastAPI app on Hugging Face Spaces
- Dockerfile +17 -0
Dockerfile
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use a slim Python 3.10 base image
|
2 |
+
FROM python:3.10-slim
|
3 |
+
|
4 |
+
# Set the working directory inside the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Copy and install Python dependencies
|
8 |
+
COPY requirements.txt .
|
9 |
+
RUN pip install --upgrade pip && \
|
10 |
+
pip install --no-cache-dir -r requirements.txt
|
11 |
+
|
12 |
+
# Copy the backend and frontend source code
|
13 |
+
COPY backend/ backend/
|
14 |
+
COPY frontend/ frontend/
|
15 |
+
|
16 |
+
# Expose FastAPI app on port 7860 (required by Hugging Face)
|
17 |
+
CMD ["uvicorn", "backend.app:app", "--host", "0.0.0.0", "--port", "7860"]
|