moamen270 commited on
Commit
957fb4a
·
1 Parent(s): 0a33d67

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -4
Dockerfile CHANGED
@@ -2,10 +2,23 @@ FROM python:3.9
2
 
3
  WORKDIR /code
4
 
5
- COPY ./requirements.txt /code/requirements.txt
6
 
7
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
8
 
9
- COPY . .
10
 
11
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  WORKDIR /code
4
 
5
+ COPY requirements-fastapi.txt ./
6
 
7
+ # Installing libGL
8
+ RUN apt-get update && apt-get install -y \
9
+ libgl1-mesa-dev
10
 
11
+ RUN apt-get install -y poppler-utils libpoppler-cpp-dev
12
 
13
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements-fastapi.txt
14
+
15
+ RUN useradd -m -u 1000 user
16
+ USER user
17
+ ENV HOME=/home/user \
18
+ PATH=/home/user/.local/bin:$PATH
19
+
20
+ WORKDIR $HOME/app
21
+
22
+ COPY --chown=user . $HOME/app/
23
+
24
+ CMD ["uvicorn", "endpoints:app", "--host", "0.0.0.0", "--port", "7860"]