Dockerfile.base 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ARG ARCH=amd64
  2. ARG WHEELS_VERSION
  3. ARG FFMPEG_VERSION
  4. ARG NGINX_VERSION
  5. FROM blakeblackshear/frigate-wheels:${WHEELS_VERSION}-${ARCH} as wheels
  6. FROM blakeblackshear/frigate-ffmpeg:${FFMPEG_VERSION}-${ARCH} as ffmpeg
  7. FROM blakeblackshear/frigate-nginx:${NGINX_VERSION} as nginx
  8. FROM frigate-web as web
  9. FROM ubuntu:20.04
  10. LABEL maintainer "blakeb@blakeshome.com"
  11. # s6-overlay
  12. ADD https://github.com/just-containers/s6-overlay/releases/download/v2.2.0.1/s6-overlay-amd64-installer /tmp/
  13. RUN chmod +x /tmp/s6-overlay-amd64-installer && /tmp/s6-overlay-amd64-installer /
  14. COPY --from=ffmpeg /usr/local /usr/local/
  15. COPY --from=wheels /wheels/. /wheels/
  16. ENV FLASK_ENV=development
  17. # ENV FONTCONFIG_PATH=/etc/fonts
  18. ENV DEBIAN_FRONTEND=noninteractive
  19. # Install packages for apt repo
  20. RUN apt-get -qq update \
  21. && apt-get upgrade -y \
  22. && apt-get -qq install --no-install-recommends -y gnupg wget unzip tzdata libxml2 \
  23. && apt-get -qq install --no-install-recommends -y python3-pip \
  24. && pip3 install -U /wheels/*.whl \
  25. && APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn apt-key adv --fetch-keys https://packages.cloud.google.com/apt/doc/apt-key.gpg \
  26. && echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list \
  27. && echo "libedgetpu1-max libedgetpu/accepted-eula select true" | debconf-set-selections \
  28. && apt-get -qq update && apt-get -qq install --no-install-recommends -y libedgetpu1-max=15.0 \
  29. && rm -rf /var/lib/apt/lists/* /wheels \
  30. && (apt-get autoremove -y; apt-get autoclean -y)
  31. RUN pip3 install \
  32. peewee_migrate \
  33. zeroconf \
  34. voluptuous\
  35. ws4py
  36. COPY --from=nginx /usr/local/nginx/ /usr/local/nginx/
  37. # get model and labels
  38. COPY labelmap.txt /labelmap.txt
  39. RUN wget -q https://github.com/google-coral/test_data/raw/master/ssdlite_mobiledet_coco_qat_postprocess_edgetpu.tflite -O /edgetpu_model.tflite
  40. RUN wget -q https://github.com/google-coral/test_data/raw/master/ssdlite_mobiledet_coco_qat_postprocess.tflite -O /cpu_model.tflite
  41. WORKDIR /opt/frigate/
  42. ADD frigate frigate/
  43. ADD migrations migrations/
  44. COPY --from=web /opt/frigate/build web/
  45. COPY docker/rootfs/ /
  46. EXPOSE 5000
  47. EXPOSE 1935
  48. ENTRYPOINT ["/init"]
  49. CMD ["python3", "-u", "-m", "frigate"]