rishitha commited on
Commit
b1c3deb
·
verified ·
1 Parent(s): 14c7516

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -21
Dockerfile CHANGED
@@ -1,29 +1,25 @@
1
- #FROM python:3.10
 
2
 
3
- # Create non-root user
4
- #RUN useradd -m -u 1000 user
5
- #USER user
6
-
7
- # Set workdir and copy files
8
- #WORKDIR /app
9
- #COPY --chown=user requirements.txt .
10
- #RUN pip install --no-cache-dir -r requirements.txt
11
- #COPY --chown=user . .
12
-
13
- # Expose the Flask default port
14
- #EXPOSE 7860
15
 
16
- # Run the Flask app
17
- #CMD ["python", "app.py"]
18
- FROM python:3.10-slim
19
 
20
- WORKDIR /app
 
21
 
 
22
  COPY . .
23
 
24
- RUN pip install --upgrade pip
25
- RUN pip install -r requirements.txt
26
-
27
  EXPOSE 7860
28
 
29
- CMD python app.py
 
 
 
 
 
 
 
1
+ # Base image
2
+ FROM python:3.9-slim
3
 
4
+ # Set working directory
5
+ WORKDIR /app
 
 
 
 
 
 
 
 
 
 
6
 
7
+ # Copy requirement files
8
+ COPY requirements.txt .
 
9
 
10
+ # Install dependencies
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
 
13
+ # Copy the rest of the code
14
  COPY . .
15
 
16
+ # Expose port (Spaces expects 7860 or 5000)
 
 
17
  EXPOSE 7860
18
 
19
+ # Set environment variable for Flask
20
+ ENV FLASK_APP=app.py
21
+ ENV FLASK_RUN_PORT=7860
22
+ ENV FLASK_RUN_HOST=0.0.0.0
23
+
24
+ # Run the Flask app
25
+ CMD ["flask", "run"]