Arafath10 commited on
Commit
5c05f26
1 Parent(s): e84fb4f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -3
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Use the official Python 3.9 image
2
  FROM python:3.10.13
3
 
4
  # Set the working directory to /code
@@ -10,15 +10,18 @@ COPY ./requirements.txt /code/requirements.txt
10
  # Install requirements.txt
11
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
12
 
 
13
  RUN playwright install --with-deps
14
 
15
  # Set up a new user named "user" with user ID 1000
16
  RUN useradd -m -u 1000 user
 
17
  # Switch to the "user" user
18
  USER user
 
19
  # Set home to the user's home directory
20
  ENV HOME=/home/user \
21
- PATH=/home/user/.local/bin:$PATH
22
 
23
  # Set the working directory to the user's home directory
24
  WORKDIR $HOME/app
@@ -26,4 +29,9 @@ WORKDIR $HOME/app
26
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
27
  COPY --chown=user . $HOME/app
28
 
29
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
1
+ # Use the official Python 3.10 image
2
  FROM python:3.10.13
3
 
4
  # Set the working directory to /code
 
10
  # Install requirements.txt
11
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
12
 
13
+ # Install Playwright and its dependencies
14
  RUN playwright install --with-deps
15
 
16
  # Set up a new user named "user" with user ID 1000
17
  RUN useradd -m -u 1000 user
18
+
19
  # Switch to the "user" user
20
  USER user
21
+
22
  # Set home to the user's home directory
23
  ENV HOME=/home/user \
24
+ PATH=/home/user/.local/bin:$PATH
25
 
26
  # Set the working directory to the user's home directory
27
  WORKDIR $HOME/app
 
29
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
30
  COPY --chown=user . $HOME/app
31
 
32
+ # Install Playwright browsers as the "user" user
33
+ RUN playwright install
34
+ # Install Playwright and its dependencies
35
+ RUN playwright install --with-deps
36
+
37
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]