Skip to content

Instantly share code, notes, and snippets.

@Nurmukhamed
Last active June 8, 2026 04:55
Show Gist options
  • Select an option

  • Save Nurmukhamed/33bdcaf2e8b5a60544ca6e902cb86ea4 to your computer and use it in GitHub Desktop.

Select an option

Save Nurmukhamed/33bdcaf2e8b5a60544ca6e902cb86ea4 to your computer and use it in GitHub Desktop.
Some examples for frigate docker-compose.yaml
name: frigate
services:
cloudflared:
image: docker.io/cloudflare/cloudflared:1800-17533b124c22
container_name: cloudflared
depends_on:
frigate:
condition: service_healthy
command:
- "tunnel"
- "--metrics"
- "0.0.0.0:2000"
- "--no-autoupdate"
- "run"
- "--token"
- "CLOUDFLARETUNNELTOKEN"
restart: unless-stopped
healthcheck:
test: ["CMD", "cloudflared", "tunnel", "--metrics", "0.0.0.0:2000", "ready"]
interval: 1s
timeout: 2s
retries: 60
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
user: "65532:65532"
deploy:
resources:
limits:
memory: 256M
cpus: '0.5'
reservations:
memory: 64M
cpus: '0.1'
frigate:
# build:
# context: /opt/docker/frigate
image: ghcr.io/blakeblackshear/frigate:0.16.3
container_name: frigate
volumes:
- /etc/localtime:/etc/localtime:ro
- /opt/frigate/config:/config
- /opt/frigate/db:/db
- /opt/frigate/storage:/media/frigate
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- '192.168.1.6:8554:8554' # RTSP feeds
- '192.168.1.6:8555:8555/tcp' # WebRTC over tcp
- '192.168.1.6:8555:8555/udp' # WebRTC over udp
# - '192.168.1.6:5000:5000' # Use for initial admin password setup.
- '192.168.1.6:8971:8971'
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://frigate:5000/api/stats"]
interval: 1m
timeout: 10s
retries: 3
start_period: 40s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
deploy:
resources:
limits:
memory: 8G
cpus: "3.0"
reservations:
memory: 2G
devices:
- /dev/apex_0:/dev/apex_0 # Passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
- /dev/apex_1:/dev/apex_1 # Passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
- /dev/dri/renderD128:/dev/dri/renderD128
privileged: true # this may not be necessary for all setups
shm_size: "1024mb" # update for your cameras based on calculation above
name: esphome
services:
esphome:
image: esphome/esphome:stable
container_name: esphome
volumes:
- /opt/hass/esphome:/config
- /etc/localtime:/etc/localtime:ro
ports:
- '192.168.91.6:6052:6052'
restart: unless-stopped
deploy:
resources:
limits:
memory: 1G
reservations:
memory: 256M
privileged: true
name: frigate
services:
frigate:
# build:
# context: /opt/docker/frigate
image: ghcr.io/blakeblackshear/frigate:0.16.3
container_name: frigate
volumes:
- /etc/localtime:/etc/localtime:ro
- /opt/frigate/config:/config
- /opt/frigate/db:/db
- /opt/frigate/storage:/media/frigate
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- '192.168.1.6:8554:8554' # RTSP feeds
- '192.168.1.6:8555:8555/tcp' # WebRTC over tcp
- '192.168.1.6:8555:8555/udp' # WebRTC over udp
# - '192.168.1.6:5000:5000' # Use for initial admin password setup.
- '192.168.1.6:8971:8971'
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://frigate:5000/api/stats"]
interval: 1m
timeout: 10s
retries: 3
start_period: 40s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
deploy:
resources:
limits:
memory: 8G
cpus: "3.0"
reservations:
memory: 2G
devices:
- /dev/apex_0:/dev/apex_0 # Passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
- /dev/apex_1:/dev/apex_1 # Passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
- /dev/dri/renderD128:/dev/dri/renderD128
privileged: true # this may not be necessary for all setups
shm_size: "1024mb" # update for your cameras based on calculation above
homeassistant:
image: 'ghcr.io/home-assistant/home-assistant:stable'
container_name: homeassistant
volumes:
- /opt/hass/config:/config
- /opt/hass/db:/db
- /opt/hass/tls:/tls
- /etc/localtime:/etc/localtime:ro
ports:
- '192.168.1.6:8123:8123'
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8123"]
interval: 1m
timeout: 10s
retries: 3
start_period: 40s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
deploy:
resources:
limits:
memory: 2G
reservations:
memory: 512M
privileged: true
mosquitto:
image: eclipse-mosquitto:2.0.20
container_name: mosquitto
volumes:
- /opt/hass/mosquitto/config:/mosquitto/config
- /opt/hass/mosquitto/data:/mosquitto/data
- /opt/hass/mosquitto/log:/mosquitto/log
ports:
- '192.168.1.6:1883:1883'
- '192.168.1.6:9001:9001'
restart: unless-stopped
healthcheck:
test: ["CMD", "mosquitto_sub", "-u", "test", "-P", "testpass", "-t", "$$SYS/broker/version", "-C", "1", "-E"]
interval: 30s
timeout: 10s
retries: 5
start_period: 10s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
deploy:
resources:
limits:
memory: 256M
reservations:
memory: 64M
name: frigate
services:
frigate:
# build:
# context: /opt/docker/frigate
image: ghcr.io/blakeblackshear/frigate:0.16.3
container_name: frigate
volumes:
- /etc/localtime:/etc/localtime:ro
- /opt/frigate/config:/config
- /opt/frigate/db:/db
- /opt/frigate/storage:/media/frigate
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- '192.168.1.6:8554:8554' # RTSP feeds
- '192.168.1.6:8555:8555/tcp' # WebRTC over tcp
- '192.168.1.6:8555:8555/udp' # WebRTC over udp
# - '192.168.1.6:5000:5000' # Use for initial admin password setup.
- '192.168.1.6:8971:8971'
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://frigate:5000/api/stats"]
interval: 1m
timeout: 10s
retries: 3
start_period: 40s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
deploy:
resources:
limits:
memory: 8G
cpus: "3.0"
reservations:
memory: 2G
devices:
- /dev/apex_0:/dev/apex_0 # Passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
- /dev/apex_1:/dev/apex_1 # Passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
- /dev/dri/renderD128:/dev/dri/renderD128
privileged: true # this may not be necessary for all setups
shm_size: "1024mb" # update for your cameras based on calculation above
redis:
image: redis:7.2.3-alpine3.18
# volumes:
# - /mnt/docker/redis/data:/data
command:
- 'redis-server'
- '--save 900 1'
- '--save 300 10'
- '--save 60 100'
- '--maxmemory 400mb'
- '--maxmemory-policy allkeys-lru'
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 128M
telegram:
image: ghcr.io/oldtyt/frigate-telegram:main-amd64-7e450ea
volumes:
- type: tmpfs # Optional
target: /tmp
tmpfs:
size: 536870912
environment:
TELEGRAM_BOT_TOKEN: 1234567890123456789012345678901234567890123456
FRIGATE_URL: http://frigate:5000
FRIGATE_EVENT_LIMIT: 5
DEBUG: False
TELEGRAM_CHAT_ID: "-1234567890"
SLEEP_TIME: 30
FRIGATE_EXTERNAL_URL: http://frigate:5000
TZ: Asia/Aqtobe
REDIS_ADDR: "redis:6379"
REST_API_ENABLE: False
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 128M
name: frigate
services:
frigate:
# build:
# context: /opt/docker/frigate
image: ghcr.io/blakeblackshear/frigate:0.16.3
container_name: frigate
volumes:
- /etc/localtime:/etc/localtime:ro
- /opt/frigate/config:/config
- /opt/frigate/db:/db
- /opt/frigate/storage:/media/frigate
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- '192.168.1.6:8554:8554' # RTSP feeds
- '192.168.1.6:8555:8555/tcp' # WebRTC over tcp
- '192.168.1.6:8555:8555/udp' # WebRTC over udp
# - '192.168.1.6:5000:5000' # Use for initial admin password setup.
- '192.168.1.6:8971:8971'
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://frigate:5000/api/stats"]
interval: 1m
timeout: 10s
retries: 3
start_period: 40s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
deploy:
resources:
limits:
memory: 8G
cpus: "3.0"
reservations:
memory: 2G
devices:
- /dev/apex_0:/dev/apex_0 # Passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
- /dev/apex_1:/dev/apex_1 # Passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
- /dev/dri/renderD128:/dev/dri/renderD128
privileged: true # this may not be necessary for all setups
shm_size: "1024mb" # update for your cameras based on calculation above

Here are some small collection of various docker-compose files.

For mosquitto - please create a user test with testpass password before.

For cloudflared - please login to cloudflare and generate token for a new tunnel.

For esphome - I not often use it, but sometime I need it, so I created a separated file for esphome.

For homeassistant, mosquitto, frigate - some examples in internet requires them. Frigate publish messages to MQTT. HomeAssistant listen for a new messages, then start a automation scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment