amosnbn commited on
Commit
415e208
·
1 Parent(s): be906c3
Files changed (1) hide show
  1. Dockerfile +19 -3
Dockerfile CHANGED
@@ -1,9 +1,25 @@
1
  FROM python:3.11-slim
2
- ENV DEBIAN_FRONTEND=noninteractive PIP_DISABLE_PIP_VERSION_CHECK=1 PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
3
- RUN apt-get update && apt-get install -y --no-install-recommends build-essential git curl libpq-dev && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
4
  WORKDIR /app
 
 
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
 
 
7
  COPY . .
 
 
8
  ENV PORT=7860
9
- CMD ["bash","-lc","exec gunicorn -w 1 -k gthread -t 180 -b 0.0.0.0:$PORT app:app"]
 
 
 
1
  FROM python:3.11-slim
2
+ ENV DEBIAN_FRONTEND=noninteractive \
3
+ PIP_DISABLE_PIP_VERSION_CHECK=1 \
4
+ PYTHONDONTWRITEBYTECODE=1 \
5
+ PYTHONUNBUFFERED=1
6
+
7
+ # deps untuk psycopg2-binary & build wheels
8
+ RUN apt-get update && apt-get install -y --no-install-recommends \
9
+ build-essential git curl libpq-dev && \
10
+ rm -rf /var/lib/apt/lists/*
11
+
12
  WORKDIR /app
13
+
14
+ # install deps dulu (cache layer)
15
  COPY requirements.txt .
16
  RUN pip install --no-cache-dir -r requirements.txt
17
+
18
+ # copy source
19
  COPY . .
20
+
21
+ # port default Spaces
22
  ENV PORT=7860
23
+
24
+ # start gunicorn
25
+ CMD ["gunicorn", "-w", "1", "-k", "gthread", "-t", "180", "-b", "0.0.0.0:7860", "app:app"]