Akshitha1 commited on
Commit
3f4ca2d
·
verified ·
1 Parent(s): b8d324f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -10
Dockerfile CHANGED
@@ -1,17 +1,24 @@
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"]
 
1
+ FROM python:3.9-slim
2
 
3
+ # Set working directory
 
 
 
 
4
  WORKDIR /app
5
+
6
+ # Copy requirement files
7
+ COPY requirements.txt .
8
+
9
+ # Install dependencies
10
  RUN pip install --no-cache-dir -r requirements.txt
 
11
 
12
+ # Copy the rest of the code
13
+ COPY . .
14
+
15
+ # Expose port (Spaces expects 7860 or 5000)
16
  EXPOSE 7860
17
 
18
+ # Set environment variable for Flask
19
+ ENV FLASK_APP=app.py
20
+ ENV FLASK_RUN_PORT=7860
21
+ ENV FLASK_RUN_HOST=0.0.0.0
22
+
23
  # Run the Flask app
24
+ CMD ["flask", "run"]