adding s6-overlay and running jsmpeg

This commit is contained in:
Blake Blackshear 2021-03-03 07:33:50 -06:00
parent 7309c06be8
commit 46e5a042ae
10 changed files with 36 additions and 15 deletions

View File

@ -8,6 +8,9 @@ version:
web: web:
docker build --tag frigate-web --file docker/Dockerfile.web web/ docker build --tag frigate-web --file docker/Dockerfile.web web/
jsmpeg:
docker build --tag frigate-jsmpeg --file docker/Dockerfile.jsmpeg jsmpeg/
amd64_wheels: amd64_wheels:
docker build --tag blakeblackshear/frigate-wheels:1.0.3-amd64 --file docker/Dockerfile.wheels . docker build --tag blakeblackshear/frigate-wheels:1.0.3-amd64 --file docker/Dockerfile.wheels .
@ -17,7 +20,7 @@ amd64_ffmpeg:
nginx_frigate: nginx_frigate:
docker buildx build --push --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag blakeblackshear/frigate-nginx:1.0.0 --file docker/Dockerfile.nginx . docker buildx build --push --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag blakeblackshear/frigate-nginx:1.0.0 --file docker/Dockerfile.nginx .
amd64_frigate: version web amd64_frigate: version web jsmpeg
docker build --tag frigate-base --build-arg ARCH=amd64 --build-arg FFMPEG_VERSION=1.1.0 --build-arg WHEELS_VERSION=1.0.3 --build-arg NGINX_VERSION=1.0.0 --file docker/Dockerfile.base . docker build --tag frigate-base --build-arg ARCH=amd64 --build-arg FFMPEG_VERSION=1.1.0 --build-arg WHEELS_VERSION=1.0.3 --build-arg NGINX_VERSION=1.0.0 --file docker/Dockerfile.base .
docker build --tag frigate --file docker/Dockerfile.amd64 . docker build --tag frigate --file docker/Dockerfile.amd64 .
@ -29,7 +32,7 @@ amd64nvidia_wheels:
amd64nvidia_ffmpeg: amd64nvidia_ffmpeg:
docker build --tag blakeblackshear/frigate-ffmpeg:1.0.0-amd64nvidia --file docker/Dockerfile.ffmpeg.amd64nvidia . docker build --tag blakeblackshear/frigate-ffmpeg:1.0.0-amd64nvidia --file docker/Dockerfile.ffmpeg.amd64nvidia .
amd64nvidia_frigate: version web amd64nvidia_frigate: version web jsmpeg
docker build --tag frigate-base --build-arg ARCH=amd64nvidia --build-arg FFMPEG_VERSION=1.0.0 --build-arg WHEELS_VERSION=1.0.3 --build-arg NGINX_VERSION=1.0.0 --file docker/Dockerfile.base . docker build --tag frigate-base --build-arg ARCH=amd64nvidia --build-arg FFMPEG_VERSION=1.0.0 --build-arg WHEELS_VERSION=1.0.3 --build-arg NGINX_VERSION=1.0.0 --file docker/Dockerfile.base .
docker build --tag frigate --file docker/Dockerfile.amd64nvidia . docker build --tag frigate --file docker/Dockerfile.amd64nvidia .
@ -41,7 +44,7 @@ aarch64_wheels:
aarch64_ffmpeg: aarch64_ffmpeg:
docker build --tag blakeblackshear/frigate-ffmpeg:1.0.0-aarch64 --file docker/Dockerfile.ffmpeg.aarch64 . docker build --tag blakeblackshear/frigate-ffmpeg:1.0.0-aarch64 --file docker/Dockerfile.ffmpeg.aarch64 .
aarch64_frigate: version web aarch64_frigate: version web jsmpeg
docker build --tag frigate-base --build-arg ARCH=aarch64 --build-arg FFMPEG_VERSION=1.0.0 --build-arg WHEELS_VERSION=1.0.3 --build-arg NGINX_VERSION=1.0.0 --file docker/Dockerfile.base . docker build --tag frigate-base --build-arg ARCH=aarch64 --build-arg FFMPEG_VERSION=1.0.0 --build-arg WHEELS_VERSION=1.0.3 --build-arg NGINX_VERSION=1.0.0 --file docker/Dockerfile.base .
docker build --tag frigate --file docker/Dockerfile.aarch64 . docker build --tag frigate --file docker/Dockerfile.aarch64 .
@ -53,7 +56,7 @@ armv7_wheels:
armv7_ffmpeg: armv7_ffmpeg:
docker build --tag blakeblackshear/frigate-ffmpeg:1.0.0-armv7 --file docker/Dockerfile.ffmpeg.armv7 . docker build --tag blakeblackshear/frigate-ffmpeg:1.0.0-armv7 --file docker/Dockerfile.ffmpeg.armv7 .
armv7_frigate: version web armv7_frigate: version web jsmpeg
docker build --tag frigate-base --build-arg ARCH=armv7 --build-arg FFMPEG_VERSION=1.0.0 --build-arg WHEELS_VERSION=1.0.3 --build-arg NGINX_VERSION=1.0.0 --file docker/Dockerfile.base . docker build --tag frigate-base --build-arg ARCH=armv7 --build-arg FFMPEG_VERSION=1.0.0 --build-arg WHEELS_VERSION=1.0.3 --build-arg NGINX_VERSION=1.0.0 --file docker/Dockerfile.base .
docker build --tag frigate --file docker/Dockerfile.armv7 . docker build --tag frigate --file docker/Dockerfile.armv7 .

View File

@ -23,7 +23,7 @@ services:
- "5000:5000" - "5000:5000"
- "5001:5001" - "5001:5001"
- "8080:8080" - "8080:8080"
command: /bin/sh -c "sudo /usr/local/nginx/sbin/nginx; while sleep 1000; do :; done" command: /bin/sh -c "while sleep 1000; do :; done"
mqtt: mqtt:
container_name: mqtt container_name: mqtt
image: eclipse-mosquitto:1.6 image: eclipse-mosquitto:1.6

View File

@ -6,10 +6,15 @@ FROM blakeblackshear/frigate-wheels:${WHEELS_VERSION}-${ARCH} as wheels
FROM blakeblackshear/frigate-ffmpeg:${FFMPEG_VERSION}-${ARCH} as ffmpeg FROM blakeblackshear/frigate-ffmpeg:${FFMPEG_VERSION}-${ARCH} as ffmpeg
FROM blakeblackshear/frigate-nginx:${NGINX_VERSION} as nginx FROM blakeblackshear/frigate-nginx:${NGINX_VERSION} as nginx
FROM frigate-web as web FROM frigate-web as web
FROM frigate-jsmpeg as jsmpeg
FROM ubuntu:20.04 FROM ubuntu:20.04
LABEL maintainer "blakeb@blakeshome.com" LABEL maintainer "blakeb@blakeshome.com"
# 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 /
COPY --from=ffmpeg /usr/local /usr/local/ COPY --from=ffmpeg /usr/local /usr/local/
COPY --from=wheels /wheels/. /wheels/ COPY --from=wheels /wheels/. /wheels/
@ -39,7 +44,6 @@ RUN pip3 install \
gevent-websocket gevent-websocket
COPY --from=nginx /usr/local/nginx/ /usr/local/nginx/ COPY --from=nginx /usr/local/nginx/ /usr/local/nginx/
COPY nginx/nginx.conf /usr/local/nginx/conf/nginx.conf
# get model and labels # get model and labels
COPY labelmap.txt /labelmap.txt COPY labelmap.txt /labelmap.txt
@ -52,10 +56,14 @@ ADD migrations migrations/
COPY --from=web /opt/frigate/build web/ COPY --from=web /opt/frigate/build web/
COPY run.sh /run.sh COPY --from=jsmpeg /opt/build jsmpeg/
RUN chmod +x /run.sh COPY --from=jsmpeg /usr/local/bin/node /usr/local/bin/node
COPY docker/rootfs/ /
EXPOSE 5000 EXPOSE 5000
EXPOSE 1935 EXPOSE 1935
CMD ["/run.sh"] ENTRYPOINT ["/init"]
CMD ["python3", "-u", "-m", "frigate"]

View File

@ -4,8 +4,7 @@ FROM node:${NODE_VERSION}
WORKDIR /opt/build WORKDIR /opt/build
COPY jsmpeg/. . COPY . .
RUN npm install --no-progress && \ RUN npm install --no-progress && \
npm run build && \
npm prune --production --ignore-scripts --prefer-offline npm prune --production --ignore-scripts --prefer-offline

View File

@ -0,0 +1,5 @@
#!/usr/bin/execlineb -S1
if { s6-test ${1} -ne 0 }
if { s6-test ${1} -ne 256 }
s6-svscanctl -t /var/run/s6/services

View File

@ -0,0 +1,2 @@
#!/usr/bin/execlineb -P
/usr/local/bin/node /opt/frigate/jsmpeg/relay.js 8081 8082

View File

@ -0,0 +1,5 @@
#!/usr/bin/execlineb -S1
if { s6-test ${1} -ne 0 }
if { s6-test ${1} -ne 256 }
s6-svscanctl -t /var/run/s6/services

View File

@ -0,0 +1,2 @@
#!/usr/bin/execlineb -P
/usr/local/nginx/sbin/nginx

View File

@ -1,3 +1,4 @@
daemon off;
worker_processes 1; worker_processes 1;
error_log /usr/local/nginx/logs/error.log warn; error_log /usr/local/nginx/logs/error.log warn;

4
run.sh
View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
/usr/local/nginx/sbin/nginx
exec python3 -u -m frigate