umair894 commited on
Commit
57678c4
·
1 Parent(s): 5827f05

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -0
Dockerfile ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the official Python 3.9 image
2
+ FROM python:3.9
3
+
4
+ RUN apt-get update && apt-get install -y \
5
+ tesseract-ocr-all \
6
+ && rm -rf /var/lib/apt/lists/*
7
+
8
+ # Set the working directory to /code
9
+ WORKDIR /code
10
+
11
+ # Copy the current directory contents into the container at /code
12
+ COPY ./requirements.txt /code/requirements.txt
13
+
14
+ # Install requirements.txt
15
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
16
+
17
+ # Set up a new user named "user" with user ID 1000
18
+ RUN useradd -m -u 1000 user
19
+ # Switch to the "user" user
20
+ USER user
21
+ # Set home to the user's home directory
22
+ ENV HOME=/home/user \
23
+ PATH=/home/user/.local/bin:$PATH
24
+
25
+ # Set the working directory to the user's home directory
26
+ WORKDIR $HOME/app
27
+
28
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
29
+ COPY --chown=user . $HOME/app
30
+
31
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]