Spaces:
Runtime error
Runtime error
Upload Dockerfile
Browse files- Dockerfile +21 -0
Dockerfile
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use official Python image
|
2 |
+
FROM python:3.10-slim
|
3 |
+
|
4 |
+
# Set working directory
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Install system dependencies
|
8 |
+
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
9 |
+
|
10 |
+
# Install Python dependencies
|
11 |
+
COPY requirements.txt .
|
12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
13 |
+
|
14 |
+
# Copy application code
|
15 |
+
COPY . .
|
16 |
+
|
17 |
+
# Expose port (Hugging Face uses 7860 by default)
|
18 |
+
EXPOSE 7860
|
19 |
+
|
20 |
+
# Start FastAPI app with uvicorn
|
21 |
+
CMD ["uvicorn", "sentiment_api:app", "--host", "0.0.0.0", "--port", "7860"]
|