Praveen0309 commited on
Commit
7c652d8
·
1 Parent(s): ba0d90a

updated dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -4
Dockerfile CHANGED
@@ -1,10 +1,16 @@
1
  FROM python:3.10
2
- WORKDIR /app
3
- RUN chmod 777 /app
 
 
 
 
 
4
  ENV FLASK_APP=app.py
5
  ENV FLASK_RUN_HOST=0.0.0.0
6
  COPY requirements.txt requirements.txt
7
- RUN pip install -r requirements.txt
8
  EXPOSE 7860
9
- COPY . .
 
10
  CMD ["flask", "run"]
 
1
  FROM python:3.10
2
+ RUN useradd -m -u 1000 user
3
+ # Set home to the user's home directory
4
+ ENV HOME=/home/user \
5
+ PATH=/home/user/.local/bin:$PATH
6
+ # Set the working directory to the user's home directory
7
+ WORKDIR $HOME/app
8
+ RUN chmod 777 $HOME/app
9
  ENV FLASK_APP=app.py
10
  ENV FLASK_RUN_HOST=0.0.0.0
11
  COPY requirements.txt requirements.txt
12
+ RUN pip install --no-cache-dir --upgrade pip
13
  EXPOSE 7860
14
+ COPY --chown=user . $HOME/app
15
+
16
  CMD ["flask", "run"]