Update Dockerfile
Browse files- Dockerfile +13 -17
Dockerfile
CHANGED
|
@@ -1,25 +1,21 @@
|
|
| 1 |
-
#
|
| 2 |
-
FROM python:3.9
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
RUN
|
| 6 |
-
USER user
|
| 7 |
|
| 8 |
-
# Set
|
| 9 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
| 10 |
-
|
| 11 |
-
# Set the working directory
|
| 12 |
WORKDIR /app
|
| 13 |
|
| 14 |
-
# Copy the requirements and install dependencies
|
| 15 |
-
COPY
|
| 16 |
-
RUN pip install --no-cache-dir
|
| 17 |
|
| 18 |
-
# Copy the rest of the application
|
| 19 |
-
COPY
|
| 20 |
|
| 21 |
-
# Expose port
|
| 22 |
EXPOSE 7860
|
| 23 |
|
| 24 |
-
# Command to run the FastAPI app
|
| 25 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# Use an official lightweight Python image.
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# Install system dependencies (poppler-utils is required by pdf2image)
|
| 5 |
+
RUN apt-get update && apt-get install -y poppler-utils && rm -rf /var/lib/apt/lists/*
|
|
|
|
| 6 |
|
| 7 |
+
# Set the working directory.
|
|
|
|
|
|
|
|
|
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
+
# Copy the requirements file and install dependencies.
|
| 11 |
+
COPY requirements.txt .
|
| 12 |
+
RUN pip install --no-cache-dir -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 |
+
# Command to run the FastAPI app with uvicorn.
|
| 21 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|