forked from MT-Photos/mt-photos-deepface
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (22 loc) · 1.09 KB
/
Copy pathDockerfile
File metadata and controls
29 lines (22 loc) · 1.09 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
# FROM python:3.8.10-buster
FROM tensorflow/tensorflow:2.10.0-gpu
USER root
# COPY ./sources.list /etc/apt/sources.list
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
RUN apt update && \
apt install -y libgl1-mesa-glx libglib2.0-0 libsm6 libxrender1 libfontconfig1 wget && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/log/*
WORKDIR /app
COPY requirements.txt .
# 安装依赖包
RUN pip3 install --no-cache-dir -r requirements.txt
RUN pip install ultralytics
RUN mkdir -p /models/.deepface/weights
RUN wget -nv -O /models/.deepface/weights/retinaface.h5 https://github.com/serengil/deepface_models/releases/download/v1.0/retinaface.h5
RUN wget -nv -O /models/.deepface/weights/vgg_face_weights.h5 https://github.com/serengil/deepface_models/releases/download/v1.0/vgg_face_weights.h5
COPY server.py .
ENV DEEPFACE_HOME=/models
ENV API_AUTH_KEY=mt_photos_ai_extra
EXPOSE 8066
CMD [ "python3", "server.py" ]