Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +11 -12
Dockerfile
CHANGED
|
@@ -1,20 +1,19 @@
|
|
| 1 |
-
|
| 2 |
-
FROM python:3.11-slim
|
| 3 |
|
| 4 |
-
# Set the working directory inside the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
# Install dependencies
|
|
|
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
# Expose FastAPI's default port
|
| 17 |
-
EXPOSE 8000
|
| 18 |
|
| 19 |
-
# Run the FastAPI app
|
| 20 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
|
|
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install system packages if needed (optional)
|
| 6 |
+
RUN apt-get update && apt-get install -y build-essential git && rm -rf /var/lib/apt/lists/*
|
| 7 |
+
|
| 8 |
+
# Copy project files
|
| 9 |
+
COPY . .
|
| 10 |
|
| 11 |
# Install dependencies
|
| 12 |
+
RUN pip install --upgrade pip
|
| 13 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
|
| 15 |
+
# Expose port
|
| 16 |
+
EXPOSE 7860
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
# Run the FastAPI app using uvicorn
|
| 19 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|