Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -17
Dockerfile
CHANGED
@@ -1,25 +1,21 @@
|
|
1 |
-
#
|
2 |
-
FROM python:3.
|
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
|
15 |
-
COPY
|
16 |
-
RUN pip install --
|
17 |
|
18 |
-
# Copy the
|
19 |
-
COPY
|
20 |
|
21 |
-
# Expose port
|
22 |
EXPOSE 7860
|
23 |
|
24 |
-
# Command to run the FastAPI app using uvicorn
|
25 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
# Use an official Python runtime as a parent image.
|
2 |
+
FROM python:3.10-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 requirements and install Python dependencies.
|
11 |
+
COPY requirements.txt .
|
12 |
+
RUN pip install --upgrade pip && pip install -r requirements.txt
|
13 |
|
14 |
+
# Copy the application code.
|
15 |
+
COPY main.py .
|
16 |
|
17 |
+
# Expose the port FastAPI will run on.
|
18 |
EXPOSE 7860
|
19 |
|
20 |
+
# Command to run the FastAPI app using uvicorn via the module interface.
|
21 |
+
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|