psr1992 commited on
Commit
dc14db6
·
verified ·
1 Parent(s): 337f41c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -17
Dockerfile CHANGED
@@ -1,25 +1,14 @@
1
- # Use a version with manylinux wheels available
2
  FROM python:3.10-slim
3
-
4
- # Speed up installs; prefer binary wheels; keep image small
5
- ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
6
- PIP_NO_CACHE_DIR=1 \
7
- PIP_ONLY_BINARY=:all: \
8
- PYTHONDONTWRITEBYTECODE=1 \
9
- PYTHONUNBUFFERED=1
10
-
11
  WORKDIR /app
12
 
13
- # (Only if you truly need them; otherwise remove this block)
14
- # RUN apt-get update && apt-get install -y --no-install-recommends \
15
- # build-essential \
16
- # && rm -rf /var/lib/apt/lists/*
17
-
18
  COPY requirements.txt .
19
  RUN pip install -U pip wheel && pip install -r requirements.txt
20
 
21
- # Copy app + model artifacts (keep model small or use Git LFS)
22
  COPY . .
23
 
24
- # Hugging Face sets $PORT; bind to it
25
- CMD gunicorn -w 2 -k gthread -b 0.0.0.0:$PORT app:app
 
 
 
 
 
 
1
  FROM python:3.10-slim
 
 
 
 
 
 
 
 
2
  WORKDIR /app
3
 
 
 
 
 
 
4
  COPY requirements.txt .
5
  RUN pip install -U pip wheel && pip install -r requirements.txt
6
 
 
7
  COPY . .
8
 
9
+ # default if HF doesn't inject PORT for any reason
10
+ ENV PORT=7860
11
+ EXPOSE 7860
12
+
13
+ # 🔧 use shell so $PORT expands; provide default via ${PORT:-7860}
14
+ CMD ["sh","-c","gunicorn -w 2 -k gthread -b 0.0.0.0:${PORT:-7860} app:app"]