Gagan0141 commited on
Commit
47cae26
·
verified ·
1 Parent(s): 5bbd440

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -8
Dockerfile CHANGED
@@ -1,13 +1,27 @@
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"]
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Python 3.11.7
2
+ FROM python:3.11.7-slim
3
 
4
+ ENV PYTHONDONTWRITEBYTECODE=1
5
+ ENV PYTHONUNBUFFERED=1
 
6
 
7
  WORKDIR /app
8
 
9
+ # Install OS dependencies
10
+ RUN apt-get update && apt-get install -y --no-install-recommends \
11
+ build-essential \
12
+ && rm -rf /var/lib/apt/lists/*
13
 
14
+ # Copy dependency list
15
+ COPY requirements.txt .
16
+
17
+ # Install Python dependencies
18
+ RUN pip install --no-cache-dir -r requirements.txt
19
+
20
+ # Copy entire project
21
+ COPY . .
22
+
23
+ # Expose port required by HuggingFace
24
+ EXPOSE 7860
25
+
26
+ # Run Flask app on 0.0.0.0:7860 (HF requirement)
27
+ CMD ["python", "app.py"]