aqul commited on
Commit
74cb5db
·
verified ·
1 Parent(s): 26613d3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -10
Dockerfile CHANGED
@@ -3,7 +3,6 @@ FROM python:3.12-slim
3
 
4
  WORKDIR /app
5
 
6
- # Install dependency OS + ffmpeg
7
  RUN apt-get update && apt-get install -y --no-install-recommends \
8
  ffmpeg \
9
  libsm6 \
@@ -12,22 +11,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
12
  libgomp1 \
13
  libglib2.0-0 \
14
  git \
15
- && rm -rf /var/lib/apt/lists/* \
16
- && apt-get clean
17
 
18
- # Clone repository via Docker BuildKit secret
19
  RUN --mount=type=secret,id=GITHUB_REPO,required=true \
20
  git clone $(cat /run/secrets/GITHUB_REPO) .
21
 
22
- # Install dependency Python
23
- RUN pip install --no-cache-dir -r requirements.txt
24
- RUN pip install --no-cache-dir flask[async]
25
 
26
- ENV FLASK_APP=app.py
27
- ENV FLASK_RUN_HOST=0.0.0.0
28
  ENV FLASK_ENV=production
29
  ENV PORT=7860
30
 
31
  EXPOSE 7860
32
 
33
- CMD ["python", "app.py"]
 
3
 
4
  WORKDIR /app
5
 
 
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  ffmpeg \
8
  libsm6 \
 
11
  libgomp1 \
12
  libglib2.0-0 \
13
  git \
14
+ && rm -rf /var/lib/apt/lists/*
 
15
 
 
16
  RUN --mount=type=secret,id=GITHUB_REPO,required=true \
17
  git clone $(cat /run/secrets/GITHUB_REPO) .
18
 
19
+ RUN pip install --no-cache-dir -r requirements.txt \
20
+ flask[async] \
21
+ gunicorn
22
 
 
 
23
  ENV FLASK_ENV=production
24
  ENV PORT=7860
25
 
26
  EXPOSE 7860
27
 
28
+ CMD ["gunicorn", "-w", "2", "--threads", "4", "-b", "0.0.0.0:7860", "app:app"]