blakeblackshear.frigate/docker/Dockerfile.base

70 lines
2.4 KiB
Docker
Raw Normal View History

2020-09-28 14:43:04 +02:00
ARG ARCH=amd64
2021-01-17 03:03:42 +01:00
ARG WHEELS_VERSION
2020-12-19 17:50:53 +01:00
ARG FFMPEG_VERSION
2021-05-18 07:52:08 +02:00
ARG NGINX_VERSION
2021-01-17 03:03:42 +01:00
FROM blakeblackshear/frigate-wheels:${WHEELS_VERSION}-${ARCH} as wheels
2020-12-19 17:50:53 +01:00
FROM blakeblackshear/frigate-ffmpeg:${FFMPEG_VERSION}-${ARCH} as ffmpeg
2021-05-18 07:52:08 +02:00
FROM blakeblackshear/frigate-nginx:${NGINX_VERSION} as nginx
2021-01-15 14:53:44 +01:00
FROM frigate-web as web
2021-03-03 14:33:50 +01:00
FROM frigate-jsmpeg as jsmpeg
2020-09-28 14:43:04 +02:00
FROM ubuntu:20.04
2020-01-06 00:43:14 +01:00
LABEL maintainer "blakeb@blakeshome.com"
2021-03-03 14:33:50 +01:00
# s6-overlay
ADD https://github.com/just-containers/s6-overlay/releases/download/v2.2.0.1/s6-overlay-amd64-installer /tmp/
RUN chmod +x /tmp/s6-overlay-amd64-installer && /tmp/s6-overlay-amd64-installer /
2020-10-07 23:25:54 +02:00
COPY --from=ffmpeg /usr/local /usr/local/
2020-09-28 14:43:04 +02:00
COPY --from=wheels /wheels/. /wheels/
2020-10-24 18:40:44 +02:00
ENV FLASK_ENV=development
2020-12-05 15:39:45 +01:00
# ENV FONTCONFIG_PATH=/etc/fonts
2020-01-06 00:43:14 +01:00
ENV DEBIAN_FRONTEND=noninteractive
# Install packages for apt repo
2020-10-25 18:15:50 +01:00
RUN apt-get -qq update \
&& apt-get upgrade -y \
2021-05-18 07:52:08 +02: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 14:43:04 +02:00
&& pip3 install -U /wheels/*.whl \
2020-09-30 00:09:58 +02: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 14:41:08 +01:00
&& echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list \
2020-09-30 00:09:58 +02:00
&& echo "libedgetpu1-max libedgetpu/accepted-eula select true" | debconf-set-selections \
2021-05-18 07:52:08 +02:00
&& apt-get -qq update && apt-get -qq install --no-install-recommends -y libedgetpu1-max=15.0 \
2020-09-28 14:43:04 +02:00
&& rm -rf /var/lib/apt/lists/* /wheels \
2020-01-06 00:43:14 +01:00
&& (apt-get autoremove -y; apt-get autoclean -y)
RUN pip3 install \
2020-12-24 14:47:27 +01:00
peewee_migrate \
2020-12-03 15:00:23 +01:00
zeroconf \
2021-02-13 15:09:44 +01:00
voluptuous\
Flask-Sockets \
gevent \
gevent-websocket
2021-05-18 07:52:08 +02:00
COPY --from=nginx /usr/local/nginx/ /usr/local/nginx/
2020-02-18 12:55:06 +01:00
# get model and labels
2020-09-07 19:17:42 +02:00
COPY labelmap.txt /labelmap.txt
RUN wget -q https://github.com/google-coral/test_data/raw/master/ssdlite_mobiledet_coco_qat_postprocess_edgetpu.tflite -O /edgetpu_model.tflite
RUN wget -q https://github.com/google-coral/test_data/raw/master/ssdlite_mobiledet_coco_qat_postprocess.tflite -O /cpu_model.tflite
2019-02-28 13:49:27 +01:00
WORKDIR /opt/frigate/
ADD frigate frigate/
ADD migrations migrations/
2021-01-15 14:53:44 +01:00
COPY --from=web /opt/frigate/build web/
2019-01-26 15:02:59 +01:00
2021-03-03 14:33:50 +01:00
COPY --from=jsmpeg /opt/build jsmpeg/
COPY --from=jsmpeg /usr/local/bin/node /usr/local/bin/node
COPY docker/rootfs/ /
2020-11-28 14:58:27 +01:00
EXPOSE 5000
EXPOSE 1935
2021-03-03 14:33:50 +01:00
ENTRYPOINT ["/init"]
CMD ["python3", "-u", "-m", "frigate"]