Hammad712 commited on
Commit
e91cd29
·
verified ·
1 Parent(s): af54968

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -3
Dockerfile CHANGED
@@ -1,6 +1,11 @@
1
- # Base image using Python 3.9
2
  FROM python:3.9
3
 
 
 
 
 
 
 
4
  # Create a new user to run the app
5
  RUN useradd -m -u 1000 user
6
  USER user
@@ -11,7 +16,7 @@ ENV PATH="/home/user/.local/bin:$PATH"
11
  # Set the working directory
12
  WORKDIR /app
13
 
14
- # Copy the requirements and install dependencies
15
  COPY --chown=user ./requirements.txt requirements.txt
16
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
17
 
@@ -22,4 +27,4 @@ COPY --chown=user . /app
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
  FROM python:3.9
2
 
3
+ # Install system dependencies
4
+ RUN apt-get update \
5
+ && apt-get install -y --no-install-recommends \
6
+ poppler-utils \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
  # Create a new user to run the app
10
  RUN useradd -m -u 1000 user
11
  USER user
 
16
  # Set the working directory
17
  WORKDIR /app
18
 
19
+ # Copy the requirements and install Python dependencies
20
  COPY --chown=user ./requirements.txt requirements.txt
21
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
22
 
 
27
  EXPOSE 7860
28
 
29
  # Command to run the FastAPI app using uvicorn
30
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]