haihuynh commited on
Commit
8b89993
1 Parent(s): aa0827f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -5
Dockerfile CHANGED
@@ -3,12 +3,32 @@
3
 
4
  FROM python:3.9
5
 
6
- WORKDIR /code
7
 
8
- COPY ./requirements.txt /code/requirements.txt
 
9
 
10
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
11
 
12
- COPY . .
 
13
 
14
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  FROM python:3.9
5
 
6
+ FROM python:latest
7
 
8
+ RUN apt-get update \
9
+ && apt-get install unzip python
10
 
11
+ # RUN unzip img_align_celeba.zip -d .
12
 
13
+ # Set up a new user named "user" with user ID 1000
14
+ RUN useradd -m -u 1000 user
15
 
16
+ # Switch to the "user" user
17
+ USER user
18
+
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
25
+
26
+ # Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
27
+ RUN pip install --no-cache-dir --upgrade pip
28
+
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
+ RUN cbir_system.py
33
+
34
+ CMD ["python"]