Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -5
Dockerfile
CHANGED
@@ -11,18 +11,26 @@ ENV PATH="/home/user/.local/bin:$PATH"
|
|
11 |
# Set the working directory
|
12 |
WORKDIR /app
|
13 |
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
# Copy the requirements and install dependencies
|
18 |
-
COPY --chown=user
|
19 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
20 |
|
21 |
# Copy the rest of the application
|
22 |
-
COPY --chown=user . /app
|
23 |
|
24 |
# Expose port 7860 for the application
|
25 |
EXPOSE 7860
|
26 |
|
27 |
# Command to run the FastAPI app using uvicorn
|
28 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
11 |
# Set the working directory
|
12 |
WORKDIR /app
|
13 |
|
14 |
+
# Switch to root temporarily to install packages
|
15 |
+
USER root
|
16 |
+
|
17 |
+
# Install poppler-utils
|
18 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
19 |
+
poppler-utils && \
|
20 |
+
apt-get clean && rm -rf /var/lib/apt/lists/*
|
21 |
+
|
22 |
+
# Switch back to user
|
23 |
+
USER user
|
24 |
|
25 |
# Copy the requirements and install dependencies
|
26 |
+
COPY --chown=user:user requirements.txt requirements.txt
|
27 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
28 |
|
29 |
# Copy the rest of the application
|
30 |
+
COPY --chown=user:user . /app
|
31 |
|
32 |
# Expose port 7860 for the application
|
33 |
EXPOSE 7860
|
34 |
|
35 |
# Command to run the FastAPI app using uvicorn
|
36 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|