ServerX commited on
Commit
3cbe31f
·
verified ·
1 Parent(s): 113bd93

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -0
Dockerfile ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ WORKDIR /app
4
+
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ gcc \
7
+ python3-dev \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ RUN useradd -m -u 1000 user && \
11
+ chown -R user:user /app
12
+ USER user
13
+
14
+ ENV PYTHONUNBUFFERED=1 \
15
+ PYTHONDONTWRITEBYTECODE=1 \
16
+ PORT=7860
17
+
18
+ COPY --chown=user requirements.txt .
19
+ RUN pip install --no-cache-dir --user -r requirements.txt
20
+
21
+ COPY --chown=user . .
22
+
23
+ CMD ["gunicorn", "--bind", "0.0.0.0:$PORT", "--timeout", "300", "--workers", "2", "app:app"]