-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdockerfile
More file actions
63 lines (56 loc) · 2.04 KB
/
dockerfile
File metadata and controls
63 lines (56 loc) · 2.04 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
52
53
54
55
56
57
58
59
60
61
62
63
# =========================================================
# Base image
# =========================================================
FROM python:3.10-bullseye
# =========================================================
# Environment
# =========================================================
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
DATA_ROOT=/data \
TZ=Asia/Shanghai
# =========================================================
# Replace Debian sources with Tsinghua mirror
# =========================================================
RUN sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list \
&& sed -i 's|security.debian.org|mirrors.tuna.tsinghua.edu.cn/debian-security|g' /etc/apt/sources.list
# =========================================================
# System dependencies + timezone
# =========================================================
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
git \
curl \
ca-certificates \
ffmpeg \
libglib2.0-0 \
libgl1 \
binutils \
tzdata \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& rm -rf /var/lib/apt/lists/*
# =========================================================
# pip mirror
# =========================================================
RUN python -m pip install --upgrade pip \
&& pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# =========================================================
# Python dependencies
# =========================================================
RUN pip install \
numpy \
opencv-python \
flask \
inspireface
# =========================================================
# Workdir & code
# =========================================================
WORKDIR /workspace
COPY app ./app
RUN mkdir -p /data
# =========================================================
# Entrypoint
# =========================================================
CMD ["python3", "-m", "app.face_runtime"]