frigate/docker/Dockerfile.base

88 lines
4.3 KiB
Docker
Raw Normal View History

2020-09-28 15:43:04 +03:00
ARG ARCH=amd64
2021-01-17 05:03:42 +03:00
ARG WHEELS_VERSION
2021-05-18 08:52:08 +03:00
ARG NGINX_VERSION
2022-01-11 12:26:12 +03:00
ARG BASE_IMAGE=ubuntu:20.04
2021-01-17 05:03:42 +03:00
FROM blakeblackshear/frigate-wheels:${WHEELS_VERSION}-${ARCH} as wheels
2021-05-18 08:52:08 +03:00
FROM blakeblackshear/frigate-nginx:${NGINX_VERSION} as nginx
2021-01-15 16:53:44 +03:00
FROM frigate-web as web
2020-09-28 15:43:04 +03:00
2022-01-11 12:26:12 +03:00
FROM ${BASE_IMAGE}
2020-01-06 02:43:14 +03:00
LABEL maintainer "blakeb@blakeshome.com"
2020-09-28 15:43:04 +03:00
COPY --from=wheels /wheels/. /wheels/
2020-10-24 19:40:44 +03:00
ENV FLASK_ENV=development
2020-12-05 17:39:45 +03:00
# ENV FONTCONFIG_PATH=/etc/fonts
2020-01-06 02:43:14 +03:00
ENV DEBIAN_FRONTEND=noninteractive
2022-01-11 12:26:12 +03:00
# install jellyfin-ffmpeg
RUN apt-get update && apt-get install -y wget libmysofa1 libpostproc55 librubberband2 libvidstab1.1 libzmq5 \
libcdio-cdda2 libcdio-paranoia2 libxcb-shape0 libnorm1 libpgm-5.2-0 libsodium23 libass9 libbs2b0 libflite1 liblilv-0-0 \
libavc1394-0 libcaca0 libiec61883-0 libjack-jackd2-0 libopenal1 libpulse0 libsdl2-2.0-0 libsndio7.0 libxv1 libavresample4
#ffmpeg arch: arm64, amd64, armhf
ARG FFMPEG_ARCH=arm64
ENV FFMPEG_VERSION=4.2.4
2022-01-23 19:33:57 +03:00
RUN wget -q https://launchpad.net/ubuntu/+archive/primary/+files/libavutil56_${FFMPEG_VERSION}-1ubuntu0.1_${FFMPEG_ARCH}.deb \
&& dpkg -i libavutil56_${FFMPEG_VERSION}-1ubuntu0.1_${FFMPEG_ARCH}.deb || ( \
apt-get -f -y install && dpkg -i libavutil56_${FFMPEG_VERSION}-1ubuntu0.1_${FFMPEG_ARCH}.deb) && \
wget -q https://launchpad.net/ubuntu/+archive/primary/+files/libavcodec58_${FFMPEG_VERSION}-1ubuntu0.1_${FFMPEG_ARCH}.deb && \
2022-01-11 14:58:30 +03:00
dpkg -i libavcodec58_${FFMPEG_VERSION}-1ubuntu0.1_${FFMPEG_ARCH}.deb || ( \
apt-get -f -y install && dpkg -i libavcodec58_${FFMPEG_VERSION}-1ubuntu0.1_${FFMPEG_ARCH}.deb) && \
2022-01-23 19:33:57 +03:00
wget -q https://launchpad.net/ubuntu/+archive/primary/+files/libavfilter7_${FFMPEG_VERSION}-1ubuntu0.1_${FFMPEG_ARCH}.deb && \
2022-01-11 14:58:30 +03:00
dpkg -i libavfilter7_${FFMPEG_VERSION}-1ubuntu0.1_${FFMPEG_ARCH}.deb || ( \
apt-get -f -y install && dpkg -i libavfilter7_${FFMPEG_VERSION}-1ubuntu0.1_${FFMPEG_ARCH}.deb) && \
2022-01-23 19:33:57 +03:00
wget -q https://launchpad.net/ubuntu/+archive/primary/+files/libavdevice58_${FFMPEG_VERSION}-1ubuntu0.1_${FFMPEG_ARCH}.deb && \
2022-01-11 14:58:30 +03:00
dpkg -i libavdevice58_${FFMPEG_VERSION}-1ubuntu0.1_${FFMPEG_ARCH}.deb || ( \
apt-get -f -y install && dpkg -i libavdevice58_${FFMPEG_VERSION}-1ubuntu0.1_${FFMPEG_ARCH}.deb) && \
2022-01-23 19:33:57 +03:00
wget -q https://launchpad.net/ubuntu/+archive/primary/+files/ffmpeg_${FFMPEG_VERSION}-1ubuntu0.1_${FFMPEG_ARCH}.deb && \
2022-01-11 14:58:30 +03:00
dpkg -i ffmpeg_${FFMPEG_VERSION}-1ubuntu0.1_${FFMPEG_ARCH}.deb || ( \
2022-01-23 19:33:57 +03:00
apt-get -f -y install && dpkg -i ffmpeg_${FFMPEG_VERSION}-1ubuntu0.1_${FFMPEG_ARCH}.deb) && \
rm *.deb
2022-01-11 12:26:12 +03:00
# Install packages for apt repo
2020-10-25 20:15:50 +03:00
RUN apt-get -qq update \
&& apt-get upgrade -y \
2021-05-18 08:52:08 +03:00
&& apt-get -qq install --no-install-recommends -y gnupg wget unzip tzdata libxml2 \
&& apt-get -qq install --no-install-recommends -y python3-pip \
2020-09-28 15:43:04 +03:00
&& pip3 install -U /wheels/*.whl \
2020-09-30 01:09:58 +03:00
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn apt-key adv --fetch-keys https://packages.cloud.google.com/apt/doc/apt-key.gpg \
2020-11-14 16:41:08 +03:00
&& echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list \
2020-09-30 01:09:58 +03:00
&& echo "libedgetpu1-max libedgetpu/accepted-eula select true" | debconf-set-selections \
2021-08-07 23:34:55 +03:00
&& apt-get -qq update && apt-get -qq install --no-install-recommends -y libedgetpu1-max python3-tflite-runtime python3-pycoral \
2020-09-28 15:43:04 +03:00
&& rm -rf /var/lib/apt/lists/* /wheels \
2020-01-06 02:43:14 +03:00
&& (apt-get autoremove -y; apt-get autoclean -y)
RUN pip3 install \
2020-12-24 16:47:27 +03:00
peewee_migrate \
2021-06-24 08:45:27 +03:00
pydantic \
2020-12-03 17:00:23 +03:00
zeroconf \
2021-05-30 18:31:25 +03:00
ws4py
2022-01-11 12:26:12 +03:00
RUN \
apt-get update && apt-get install -y gstreamer1.0-plugins-base-apps gstreamer1.0-tools gstreamer1.0-alsa \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
ibgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-good1.0-dev \
libgstreamer-plugins-bad1.0-dev
2021-05-18 08:52:08 +03:00
COPY --from=nginx /usr/local/nginx/ /usr/local/nginx/
2020-02-18 14:55:06 +03:00
# get model and labels
2020-09-07 20:17:42 +03:00
COPY labelmap.txt /labelmap.txt
2021-08-28 16:04:29 +03:00
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
2019-02-28 15:49:27 +03:00
WORKDIR /opt/frigate/
ADD frigate frigate/
ADD migrations migrations/
2021-01-15 16:53:44 +03:00
COPY --from=web /opt/frigate/build web/
2019-01-26 17:02:59 +03:00
2021-03-03 16:33:50 +03:00
COPY docker/rootfs/ /
2020-11-28 16:58:27 +03:00
EXPOSE 5000
2022-01-11 12:38:44 +03:00
EXPOSE 1935