mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 01:05:20 +03:00
134 lines
4.2 KiB
Docker
134 lines
4.2 KiB
Docker
ARG NGINX_VERSION
|
|
FROM blakeblackshear/frigate-nginx-l4t:${NGINX_VERSION} as nginx
|
|
FROM frigate-web as web
|
|
FROM nvcr.io/nvidia/l4t-tensorflow:r32.6.1-tf2.5-py3 as wheels
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN apt-get -qq update \
|
|
&& apt-get -qq install -y \
|
|
python3.8 \
|
|
python3.8-dev \
|
|
wget \
|
|
# opencv dependencies
|
|
build-essential cmake git pkg-config libgtk-3-dev \
|
|
libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
|
|
libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \
|
|
gfortran openexr libatlas-base-dev libssl-dev\
|
|
libtbb2 libtbb-dev libdc1394-22-dev libopenexr-dev \
|
|
libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev \
|
|
# scipy dependencies
|
|
gcc gfortran libopenblas-dev liblapack-dev cython
|
|
|
|
RUN wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \
|
|
&& python3 get-pip.py
|
|
|
|
RUN pip3 install scikit-build
|
|
|
|
RUN pip3 wheel --wheel-dir=/wheels \
|
|
opencv-python-headless \
|
|
numpy \
|
|
imutils \
|
|
scipy \
|
|
psutil \
|
|
Flask \
|
|
paho-mqtt \
|
|
PyYAML \
|
|
matplotlib \
|
|
click \
|
|
setproctitle \
|
|
peewee
|
|
|
|
FROM nvcr.io/nvidia/l4t-tensorflow:r32.6.1-tf2.5-py3
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
RUN \
|
|
apt-get update && apt-get install -y gnupg
|
|
RUN \
|
|
apt-key adv --fetch-key https://repo.download.nvidia.com/jetson/jetson-ota-public.asc && \
|
|
echo "deb https://repo.download.nvidia.com/jetson/ffmpeg main main" | tee -a /etc/apt/sources.list && \
|
|
echo "deb-src https://repo.download.nvidia.com/jetson/ffmpeg main main" | tee -a /etc/apt/sources.list && \
|
|
apt-get -qq update && \
|
|
apt-get -qq install ffmpeg
|
|
|
|
COPY --from=wheels /wheels/. /wheels/
|
|
|
|
ENV FLASK_ENV=development
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
RUN apt-get -qq update \
|
|
&& apt-get upgrade -y \
|
|
&& apt-get -qq install --no-install-recommends -y gnupg wget unzip tzdata libxml2
|
|
|
|
RUN wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \
|
|
&& python3 get-pip.py && \
|
|
pip3 install -U /wheels/*.whl
|
|
|
|
|
|
RUN \
|
|
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn apt-key adv --fetch-keys https://packages.cloud.google.com/apt/doc/apt-key.gpg \
|
|
&& echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list \
|
|
&& echo "libedgetpu1-max libedgetpu/accepted-eula select true" | debconf-set-selections \
|
|
&& apt-get -qq update
|
|
|
|
RUN \
|
|
apt-get -qq install --no-install-recommends -y libedgetpu1-max python3-tflite-runtime python3-pycoral \
|
|
&& rm -rf /var/lib/apt/lists/* /wheels \
|
|
&& (apt-get autoremove -y; apt-get autoclean -y)
|
|
|
|
RUN pip3 install \
|
|
peewee_migrate \
|
|
pydantic \
|
|
zeroconf \
|
|
ws4py \
|
|
# Python 3.6
|
|
shared-memory38
|
|
|
|
|
|
# setup gstreamer
|
|
RUN \
|
|
apt-get update && apt-get install -y software-properties-common && \
|
|
add-apt-repository universe && \
|
|
add-apt-repository multiverse && \
|
|
apt-get update
|
|
|
|
RUN \
|
|
apt-get install -y gstreamer1.0-tools gstreamer1.0-alsa \
|
|
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
|
|
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly
|
|
|
|
RUN \
|
|
apt-get install -y git libgstreamer1.0-dev \
|
|
libgstreamer-plugins-base1.0-dev \
|
|
libgstreamer-plugins-good1.0-dev \
|
|
libgstreamer-plugins-bad1.0-dev
|
|
|
|
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/tegra
|
|
|
|
RUN wget -q https://github.com/google-coral/test_data/raw/release-frogfish/ssdlite_mobiledet_coco_qat_postprocess_edgetpu.tflite -O /edgetpu_model.tflite
|
|
RUN wget -q https://github.com/google-coral/test_data/raw/release-frogfish/ssdlite_mobiledet_coco_qat_postprocess.tflite -O /cpu_model.tflite
|
|
|
|
|
|
COPY --from=nginx /usr/local/nginx/ /usr/local/nginx/
|
|
COPY --from=web /opt/frigate/build /opt/frigate/web/
|
|
|
|
# s6-overlay
|
|
COPY docker/rootfs/ /
|
|
ADD https://github.com/just-containers/s6-overlay/releases/download/v2.2.0.3/s6-overlay-aarch64-installer /tmp/
|
|
RUN chmod +x /tmp/s6-overlay-aarch64-installer && /tmp/s6-overlay-aarch64-installer /
|
|
|
|
|
|
WORKDIR /opt/frigate/
|
|
ADD frigate frigate/
|
|
ADD migrations migrations/
|
|
COPY labelmap.txt /labelmap.txt
|
|
|
|
|
|
# edgetpu experiments
|
|
RUN wget -q https://github.com/Azure/Azure-AI-Camp/releases/download/v1.0/yolov4-tiny.tflite -O /yolov4-tiny.tflite
|
|
|
|
EXPOSE 5000
|
|
EXPOSE 1935
|
|
|
|
ENTRYPOINT ["/init"]
|
|
CMD ["python3", "-u", "-m", "frigate"]
|
|
COPY frigate frigate/
|