Pendrokar commited on
Commit
1c2c959
β€’
1 Parent(s): cbd7e62

Dockerfile: gradio docker demo like

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -22
Dockerfile CHANGED
@@ -1,25 +1,4 @@
1
- # Set up a new user named "user" with user ID 1000
2
- RUN useradd -m -u 1000 user
3
-
4
- # Switch to the "user" user
5
- USER user
6
-
7
- # Set home to the user's home directory
8
- ENV HOME=/home/user \
9
- PATH=/home/user/.local/bin:$PATH
10
-
11
- # Set the working directory to the user's home directory
12
- WORKDIR $HOME/app
13
-
14
- # Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
15
- RUN pip install --no-cache-dir --upgrade pip
16
-
17
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
18
- COPY --chown=user . $HOME/app
19
-
20
- FROM docker.io/huggingface/downloader:0.17.3@sha256:b5bc7fb168c85737634c00c4099b19e251eb2e55b3523b4e389d98876b35f109
21
-
22
- FROM docker.io/library/python:3.9@sha256:5e11e0165c7e02fcb4a15772bd25e28266ed9c4e90fded5e8cc7a921affd7826
23
 
24
  RUN --mount=target=pre-requirements.txt,source=pre-requirements.txt pip install --no-cache-dir -r pre-requirements.txt
25
 
@@ -44,3 +23,5 @@ RUN pip freeze > /tmp/freeze.txt
44
  COPY --link --chown=1000 ./ /home/user/app
45
 
46
  COPY --from=pipfreeze --link --chown=1000 /tmp/freeze.txt .
 
 
 
1
+ FROM python:3.9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  RUN --mount=target=pre-requirements.txt,source=pre-requirements.txt pip install --no-cache-dir -r pre-requirements.txt
4
 
 
23
  COPY --link --chown=1000 ./ /home/user/app
24
 
25
  COPY --from=pipfreeze --link --chown=1000 /tmp/freeze.txt .
26
+
27
+ CMD ["python", "app.py"]