simran40 commited on
Commit
0faf7d0
·
verified ·
1 Parent(s): b41a235

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -9
Dockerfile CHANGED
@@ -1,14 +1,38 @@
1
- # Use Python base image
2
- FROM python:3.10-slim
 
 
 
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Copy files
8
- COPY requirements.txt requirements.txt
9
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
- COPY . .
12
 
13
- # Run app
14
- CMD ["python", "app.py"]
 
1
+ FROM python:3.9
2
+
3
+ RUN useradd -m -u 1000 user
4
+ USER user
5
+ ENV PATH="/home/user/.local/bin:$PATH"
6
 
 
7
  WORKDIR /app
8
 
9
+ COPY --chown=user ./requirements.txt requirements.txt
10
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
11
+
12
+ COPY --chown=user . /app
13
+ CMD ["gunicorn", "app:app", "-b", "0.0.0.0:7860"]
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+ # # Use Python base image
26
+ # FROM python:3.10-slim
27
+
28
+ # # Set working directory
29
+ # WORKDIR /app
30
+
31
+ # # Copy files
32
+ # COPY requirements.txt requirements.txt
33
+ # RUN pip install --no-cache-dir -r requirements.txt
34
 
35
+ # COPY . .
36
 
37
+ # # Run app
38
+ # CMD ["python", "app.py"]