switch to docker based web builds

This commit is contained in:
Blake Blackshear 2021-01-15 07:53:44 -06:00
parent bca0531963
commit b022bec1fa
3 changed files with 13 additions and 2 deletions

View File

@ -6,7 +6,7 @@ version:
echo "VERSION='0.8.0-$(COMMIT_HASH)'" > frigate/version.py echo "VERSION='0.8.0-$(COMMIT_HASH)'" > frigate/version.py
web: web:
cd web && npm install && npm run build docker build --tag frigate-web --file docker/Dockerfile.web web/
amd64_wheels: amd64_wheels:
docker build --tag blakeblackshear/frigate-wheels:amd64 --file docker/Dockerfile.wheels . docker build --tag blakeblackshear/frigate-wheels:amd64 --file docker/Dockerfile.wheels .

View File

@ -2,6 +2,7 @@ ARG ARCH=amd64
ARG FFMPEG_VERSION ARG FFMPEG_VERSION
FROM blakeblackshear/frigate-wheels:${ARCH} as wheels FROM blakeblackshear/frigate-wheels:${ARCH} as wheels
FROM blakeblackshear/frigate-ffmpeg:${FFMPEG_VERSION}-${ARCH} as ffmpeg FROM blakeblackshear/frigate-ffmpeg:${FFMPEG_VERSION}-${ARCH} as ffmpeg
FROM frigate-web as web
FROM ubuntu:20.04 FROM ubuntu:20.04
LABEL maintainer "blakeb@blakeshome.com" LABEL maintainer "blakeb@blakeshome.com"
@ -45,7 +46,8 @@ RUN wget -q https://github.com/google-coral/test_data/raw/master/ssdlite_mobiled
WORKDIR /opt/frigate/ WORKDIR /opt/frigate/
ADD frigate frigate/ ADD frigate frigate/
ADD migrations migrations/ ADD migrations migrations/
ADD web/build web/
COPY --from=web /opt/frigate/build web/
COPY run.sh /run.sh COPY run.sh /run.sh
RUN chmod +x /run.sh RUN chmod +x /run.sh

9
docker/Dockerfile.web Normal file
View File

@ -0,0 +1,9 @@
ARG NODE_VERSION=14.0
FROM node:${NODE_VERSION}
WORKDIR /opt/frigate
COPY . .
RUN npm install && npm run build