deedrop1140 commited on
Commit
f341025
·
verified ·
1 Parent(s): 8a64f2e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -57
Dockerfile CHANGED
@@ -1,57 +1,32 @@
1
- # # Use official Python base image
2
- # FROM python:3.10-slim
3
-
4
- # # Avoid Python buffering
5
- # ENV PYTHONUNBUFFERED=1
6
-
7
- # # Set work directory
8
- # WORKDIR /app
9
-
10
- # # Install system dependencies
11
- # RUN apt-get update && apt-get install -y \
12
- # build-essential \
13
- # git \
14
- # curl \
15
- # && rm -rf /var/lib/apt/lists/*
16
-
17
- # # Copy requirements.txt and install
18
- # COPY requirements.txt .
19
- # RUN pip install --upgrade pip && pip install -r requirements.txt
20
-
21
- # # Copy project files
22
- # COPY . .
23
-
24
- # # Expose port (Hugging Face expects 7860 by default, but Flask usually runs 5000)
25
- # EXPOSE 5000
26
-
27
- # # Set environment variable for Flask
28
- # ENV PORT=5000
29
- # ENV FLASK_APP=app.py
30
-
31
- # # Run Flask
32
- # CMD ["flask", "run", "--host", "0.0.0.0", "--port", "5000"]
33
-
34
- # Use lightweight Python image
35
- FROM python:3.10-slim
36
-
37
- # Environment variables
38
- ENV PYTHONUNBUFFERED=1
39
- ENV TF_CPP_MIN_LOG_LEVEL=2
40
-
41
- # Set working directory
42
- WORKDIR /app
43
-
44
- # Copy and install dependencies first (cache-friendly)
45
- COPY requirements.txt .
46
- RUN pip install --no-cache-dir --upgrade pip \
47
- && pip install --no-cache-dir -r requirements.txt
48
-
49
- # Copy app code
50
- COPY . .
51
-
52
- # Render provides PORT automatically — DO NOT hardcode
53
- CMD ["python", "app.py"]
54
-
55
-
56
-
57
-
 
1
+ # Use official Python base image
2
+ FROM python:3.11-slim
3
+
4
+ # Avoid Python buffering
5
+ ENV PYTHONUNBUFFERED=1
6
+
7
+ # Set work directory
8
+ WORKDIR /app
9
+
10
+ # Install system dependencies
11
+ RUN apt-get update && apt-get install -y \
12
+ build-essential \
13
+ git \
14
+ curl \
15
+ && rm -rf /var/lib/apt/lists/*
16
+
17
+ # Copy requirements.txt and install
18
+ COPY requirements.txt .
19
+ RUN pip install --upgrade pip && pip install -r requirements.txt
20
+
21
+ # Copy project files
22
+ COPY . .
23
+
24
+ # Expose port (Hugging Face expects 7860 by default, but Flask usually runs 5000)
25
+ EXPOSE 7860
26
+
27
+ # Set environment variable for Flask
28
+ ENV PORT=7860
29
+ ENV FLASK_APP=app.py
30
+
31
+ # Run Flask
32
+ CMD ["flask", "run", "--host", "0.0.0.0", "--port", "7860"]