Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
feat: First version (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
lholota authored Aug 15, 2022
1 parent 3b8efca commit 966a899
Show file tree
Hide file tree
Showing 18 changed files with 3,278 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"env": {
"test": {
"plugins": [
"@babel/plugin-transform-modules-commonjs"
]
}
}
}
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* text=auto
*.sh eol=lf
*.yml eol=lf
**/run eol=lf
**/finish eol=lf
**/services.d/** eol=lf
**/cont-init.d/** eol=lf
32 changes: 32 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 2
updates:
- package-ecosystem: docker
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- dependencies
commit-message:
prefix: fix
include: scope
- package-ecosystem: gradle
directory: "/tests"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- dependencies
commit-message:
prefix: chore
include: scope
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- dependencies
commit-message:
prefix: ci
include: scope
11 changes: 11 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
titleOnly: true
types:
- feat
- fix
- docs
- refactor
- test
- build
- ci
- chore
- revert
20 changes: 20 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI/CD
on:
push:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # To add version tags
packages: write # To push docker image
issues: write # Semantic release to link issues
steps:
- uses: actions/checkout@master

- uses: homecentr/action-build-docker-image@master
with:
imageName: "homecentr/frigate"
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
dockerHubUserName: ${{ secrets.DOCKERHUB_USERNAME }}
dockerHubPassword: ${{ secrets.DOCKERHUB_PASSWORD }}
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
*.class
*.jar
*.war
*.ear
.gradle
build
.gradletasknamecache

**/.idea/workspace.xml
**/.idea/tasks.xml

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

node_modules
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"node_modules": true
}
}
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM blakeblackshear/frigate:0.10.0-amd64

ARG USER_UID=1000
ARG USER_GID=1000

RUN apt-get update && \
apt-get install -y --no-install-recommends supervisor=4.1.0-1ubuntu1 && \
addgroup --gid 1000 nonroot && \
adduser -u 1000 -G nonroot -D -H -g "" nonroot && \
ln -sf /dev/stdout /usr/local/nginx/logs/access.log && \
ln -sf /dev/stderr /usr/local/nginx/logs/error.log && \
rm -rf /etc/services.d && \
rm -rf /etc/conf-init.d && \
rm -rf /etc/conf-finish.d && \
apt-get autoremove --yes && \
rm -rf /var/lib/apt && \
rm -rf /var/lib/dpkg && \
rm -rf /var/lib/cache && \
rm -rf /var/lib/log

COPY ./root/ /

USER ${USER_UID}:${USER_GID}

EXPOSE 5000
EXPOSE 1935

ENTRYPOINT [ "supervisord", "-c", "/etc/supervisor.conf" ]
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
# docker-frigate
[![Project status](https://badgen.net/badge/project%20status/stable%20%26%20actively%20maintaned?color=green)](https://github.com/homecentr/docker-frigate/graphs/commit-activity) [![](https://badgen.net/github/label-issues/homecentr/docker-frigate/bug?label=open%20bugs&color=green)](https://github.com/homecentr/docker-frigate/labels/bug) [![](https://badgen.net/github/release/homecentr/docker-frigate)](https://hub.docker.com/repository/docker/homecentr/frigate)
[![](https://badgen.net/docker/pulls/homecentr/frigate)](https://hub.docker.com/repository/docker/homecentr/frigate)
[![](https://badgen.net/docker/size/homecentr/frigate)](https://hub.docker.com/repository/docker/homecentr/frigate)

[![CI/CD](https://github.com/homecentr/docker-frigate/actions/workflows/ci_cd.yml/badge.svg)](https://github.com/homecentr/docker-frigate/actions/workflows/ci_cd.yml)


# Homecentr - Frigate

## Exposed ports

| Port | Protocol | Description |
|------|------|-------------|
| 5000 | TCP | HTTP Web UI |
| 1935 | TCP | RTSP |

## Volumes

| Container path | Description |
|------------|---------------|
| /config | The container expects config file at `/config/config.yml` |

## Security
The container is regularly scanned for vulnerabilities and updated. Further info can be found in the [Security tab](https://github.com/homecentr/docker-frigate/security).

### Container user
The container uses UID:GID of 1000:1000 by default. The image needs to be rebuilt if you need to change the UID/GID.
15 changes: 15 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Security policy

## Disclosure policy

In case you find a security issues with this docker image, please reach out to me at security@homecentr.io and provide 5 business days to release a fixed version.

## Security update policy

Known security issues will be published in GitHub repository's Security / Security advisories.

## Automated processes

The Docker image is regularly scanned for vulnerabilities with [Snyk.io](https://snyk.io/).

The dependencies are automatically scanned using [Dependabot](https://dependabot.com/). Dependencies are regularly updated. You can check for pending dependency updates by listing open Pull requests with the "dependencies" label.
32 changes: 32 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: "3.9"
services:
image:
build: .
image: homecentr/frigate:preview
user: 1000:1000
read_only: true
depends_on:
- mqtt
networks:
internal:
ports:
- "5000:5000"
- "1935:1935"
volumes:
- "./example/frigate.yml:/config/config.yml:ro"
tmpfs:
- /tmp
- /media/frigate

mqtt:
image: eclipse-mosquitto
ports:
- "1883:1883"
volumes:
- "./example/mosquitto.conf:/mosquitto/config/mosquitto.conf"
networks:
internal:

networks:
internal:
driver: bridge
18 changes: 18 additions & 0 deletions example/frigate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
mqtt:
host: mqtt
port: 1883

cameras:
camera_1:
ffmpeg:
inputs:
- path: rtsp://10.0.10.10:554/rtsp
roles:
- detect
- rtmp
detect:
width: 1280
height: 720
motion:
mask:
- 0,461,3,0,1919,0,1919,843,1699,492,1344,458,1346,336,973,317,869,375,866,432
2 changes: 2 additions & 0 deletions example/mosquitto.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
allow_anonymous true
listener 1883 0.0.0.0
32 changes: 32 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "@homecentr/frigate",
"version": "1.0.0",
"description": "",
"author": "Lukas Holota",
"license": "MIT",
"scripts": {
"build": "docker-compose build",
"start": "docker-compose up",
"start:shell": "docker-compose run --user=0:0 --entrypoint bash image",
"test": "jest --testTimeout=60000",
"push:preview": "docker-compose push image",
"clean": "docker-compose down"
},
"release": {
"branches": [
"master"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github"
]
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
"axios": "^0.27.2",
"cross-env": "^7.0.3",
"jest": "^28.1.3",
"testcontainers": "^8.12.0"
}
}
24 changes: 24 additions & 0 deletions root/etc/supervisor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[supervisord]
nodaemon=true
logfile=/dev/stdout
logfile_maxbytes = 0
pidfile=/tmp/supervisord.pid

[program:frigate]
command=python3 -u -m frigate
autostart=true
autorestart=true
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes = 0
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes = 0
pidfile=/tmp/

[program:nginx]
command=/usr/local/nginx/sbin/nginx
autostart=true
autorestart=true
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes = 0
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes = 0
Loading

0 comments on commit 966a899

Please sign in to comment.