deedrop1140 commited on
Commit
47aea9c
·
verified ·
1 Parent(s): 2088a49

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +34 -34
Dockerfile CHANGED
@@ -1,34 +1,34 @@
1
- # Use official Python base image
2
- FROM python:3.10-slim
3
-
4
- # Prevent Python from writing .pyc files & enable buffered output
5
- ENV PYTHONDONTWRITEBYTECODE=1
6
- ENV PYTHONUNBUFFERED=1
7
-
8
- # Set working directory
9
- WORKDIR /app
10
-
11
- # Install system dependencies (useful for pandas, numpy, etc.)
12
- RUN apt-get update && apt-get install -y --no-install-recommends \
13
- build-essential \
14
- git \
15
- && rm -rf /var/lib/apt/lists/*
16
-
17
- # Copy requirement file
18
- COPY requirements.txt .
19
-
20
- # Install Python dependencies
21
- RUN pip install --no-cache-dir -r requirements.txt
22
-
23
- # Copy application files
24
- COPY . .
25
-
26
- # Expose Flask default port
27
- EXPOSE 5000
28
-
29
- # Set Flask environment variables
30
- ENV FLASK_APP=app.py
31
- ENV FLASK_RUN_HOST=0.0.0.0
32
-
33
- # Run Flask application
34
- CMD ["flask", "run"]
 
1
+ # Use official Python base image
2
+ FROM python:3.10-slim
3
+
4
+ # Prevent Python from writing .pyc files & enable buffered output
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV PYTHONUNBUFFERED=1
7
+
8
+ # Set working directory
9
+ WORKDIR /app
10
+
11
+ # Install system dependencies (useful for pandas, numpy, etc.)
12
+ RUN apt-get update && apt-get install -y --no-install-recommends \
13
+ build-essential \
14
+ git \
15
+ && rm -rf /var/lib/apt/lists/*
16
+
17
+ # Copy requirement file
18
+ COPY requirements.txt .
19
+
20
+ # Install Python dependencies
21
+ RUN pip install --no-cache-dir -r requirements.txt
22
+
23
+ # Copy application files
24
+ COPY . .
25
+
26
+ # Expose port (Hugging Face expects 7860 by default, but Flask usually runs 5000)
27
+ EXPOSE 7860
28
+
29
+ # Set environment variable for Flask
30
+ ENV PORT=7860
31
+ ENV FLASK_APP=app.py
32
+
33
+ # Run Flask
34
+ CMD ["flask", "run", "--host", "0.0.0.0", "--port", "7860"]