aqul commited on
Commit
ddc7937
·
verified ·
1 Parent(s): b9500fa

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +37 -0
Dockerfile ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # syntax=docker/dockerfile:1.6
2
+ 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 \
10
+ libxext6 \
11
+ libxrender-dev \
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
+
27
+ EXPOSE 7860
28
+
29
+ RUN --mount=type=secret,id=GOOGLE_API_KEY \
30
+ cat /run/secrets/GOOGLE_API_KEY
31
+
32
+ ENV FLASK_APP=app.py
33
+ ENV FLASK_RUN_HOST=0.0.0.0
34
+ ENV FLASK_ENV=production
35
+ ENV PORT=7860
36
+
37
+ CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]