fatimazahra22-4 commited on
Commit
d7da196
·
verified ·
1 Parent(s): 1295e07

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -19
Dockerfile CHANGED
@@ -1,28 +1,27 @@
1
- FROM python:3.10
2
 
3
- # Set the working directory inside the container
4
- WORKDIR /ASF
5
 
6
- # Copy the requirements file and install dependencies
7
- COPY ./requirements.txt /asf-app/requirements.txt
8
- RUN pip install --no-cache-dir --upgrade -r /asf-app/requirements.txt
 
 
 
 
 
 
 
9
 
10
- # Create a user and switch to it
11
- RUN useradd user
 
 
12
  USER user
13
 
14
- # Set environment variables
15
  ENV HOME=/home/user \
16
- PATH=/home/user/.local/bin:$PATH
17
-
18
- # Set the working directory for the app
19
- WORKDIR $HOME/app
20
-
21
- # Copy the application code into the container
22
- COPY --chown=user . $HOME/app
23
 
24
- # Ensure the templates folder is copied (make sure it exists in your local project structure)
25
- COPY ./templates /home/user/app/templates
26
 
27
- # Set the command to run the FastAPI app
28
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--root-path", "/"]
 
1
+ FROM python:3.10-slim
2
 
3
+ WORKDIR /home/user/app
 
4
 
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ tesseract-ocr \
8
+ poppler-utils \
9
+ libglib2.0-0 \
10
+ libsm6 \
11
+ libxext6 \
12
+ libxrender-dev \
13
+ libmagic1 \
14
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
15
 
16
+ COPY requirements.txt ./requirements.txt
17
+ RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt
18
+
19
+ RUN useradd -ms /bin/bash user
20
  USER user
21
 
 
22
  ENV HOME=/home/user \
23
+ PATH=$HOME/.local/bin:$PATH
 
 
 
 
 
 
24
 
25
+ COPY --chown=user . .
 
26
 
 
27
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--root-path", "/"]