Spaces:
Paused
Paused
Create Dockerfile
Browse files- Dockerfile +21 -0
Dockerfile
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official lightweight Python image.
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
+
|
| 4 |
+
# Set a working directory.
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Install system dependencies if needed (e.g., for httpx or other libraries)
|
| 8 |
+
# RUN apt-get update && apt-get install -y gcc
|
| 9 |
+
|
| 10 |
+
# Copy requirements file and install Python dependencies.
|
| 11 |
+
COPY requirements.txt .
|
| 12 |
+
RUN pip install --upgrade pip && pip install -r requirements.txt
|
| 13 |
+
|
| 14 |
+
# Copy the rest of the application code.
|
| 15 |
+
COPY . .
|
| 16 |
+
|
| 17 |
+
# Expose the port the app runs on.
|
| 18 |
+
EXPOSE 7860
|
| 19 |
+
|
| 20 |
+
# Set the command to run the app using uvicorn.
|
| 21 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|