-
Notifications
You must be signed in to change notification settings - Fork 523
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (42 loc) · 1.1 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (42 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM python:3.12-slim
ENV TZ=Asia/Shanghai \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
BTB_SERVER_NAME=0.0.0.0 \
GRADIO_SERVER_PORT=7860 \
GRADIO_NUM_PORTS=100 \
BTB_DOCKER=1
ARG PIP_INDEX_URL=https://pypi.org/simple
WORKDIR /app
RUN apt-get update && \
apt-get install -y --no-install-recommends \
fontconfig \
fonts-wqy-microhei \
fonts-wqy-zenhei \
tzdata && \
ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime && \
echo "${TZ}" > /etc/timezone && \
fc-cache -f && \
rm -rf /var/lib/apt/lists/*
COPY requirements.txt ./
RUN python -m pip install --upgrade pip setuptools wheel && \
python -m pip install --upgrade --index-url "${PIP_INDEX_URL}" -r requirements.txt && \
python - <<'PY'
import fastapi
import gradio
import jinja2
import starlette
print(
"Resolved runtime versions:",
{
"gradio": gradio.__version__,
"fastapi": fastapi.__version__,
"starlette": starlette.__version__,
"jinja2": jinja2.__version__,
},
)
PY
COPY . .
EXPOSE 7860
CMD ["python", "main.py"]