My docker compose yaml file
Please read Liability Disclaimer and License Agreement CAREFULLY
This file is to be used as example because yours will most likely be different.
version: '3.9'
volumes:
postgres-data:
services:
portainer:
container_name: portainer
image: portainer/portainer-ce:latest
restart: always
ports:
- "9000:9000/tcp"
environment:
- TZ=Europe/Oslo
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /opt/portainer:/data
frigate:
container_name: frigate
privileged: true # this may not be necessary for all setups
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:stable
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1 # number of GPUs
capabilities: [gpu]
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
#(width * height * 1.5 * 9 + 270480)/1048576 = <shm size in mb>
shm_size: "64mb" # update for your cameras based on calculation above
devices:
- /dev/apex_0:/dev/apex_0
- /dev/dri/renderD128:/dev/dri/renderD128
- /dev/vpu_service:/dev/vpu_service
- /dev/dri/card0:/dev/dri/card0
volumes:
- /etc/localtime:/etc/localtime:ro
- /opt/frigate/frigate.yml:/config/config.yml:ro
- /nas-storage/Frigate/Media:/media/frigate
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "5000:5000"
- "1935:1935" # RTMP feeds
compreface-postgres-db:
image: ${registry}compreface-postgres-db:${POSTGRES_VERSION}
restart: always
container_name: "compreface-postgres-db"
environment:
- POSTGRES_USER=${postgres_username}
- POSTGRES_PASSWORD=${postgres_password}
- POSTGRES_DB=${postgres_db}
volumes:
- postgres-data:/var/lib/postgresql/data
compreface-admin:
restart: always
image: ${registry}compreface-admin:${ADMIN_VERSION}
container_name: "compreface-admin"
environment:
- POSTGRES_USER=${postgres_username}
- POSTGRES_PASSWORD=${postgres_password}
- POSTGRES_URL=jdbc:postgresql://${postgres_domain}:${postgres_port}/${postgres_db}
- SPRING_PROFILES_ACTIVE=dev
- ENABLE_EMAIL_SERVER=${enable_email_server}
- EMAIL_HOST=${email_host}
- EMAIL_USERNAME=${email_username}
- EMAIL_FROM=${email_from}
- EMAIL_PASSWORD=${email_password}
- ADMIN_JAVA_OPTS=${compreface_admin_java_options}
- MAX_FILE_SIZE=${max_file_size}
- MAX_REQUEST_SIZE=${max_request_size}B
depends_on:
- compreface-postgres-db
- compreface-api
compreface-api:
restart: always
image: ${registry}compreface-api:${API_VERSION}
container_name: "compreface-api"
depends_on:
- compreface-postgres-db
environment:
- POSTGRES_USER=${postgres_username}
- POSTGRES_PASSWORD=${postgres_password}
- POSTGRES_URL=jdbc:postgresql://${postgres_domain}:${postgres_port}/${postgres_db}
- SPRING_PROFILES_ACTIVE=dev
- API_JAVA_OPTS=${compreface_api_java_options}
- SAVE_IMAGES_TO_DB=${save_images_to_db}
- MAX_FILE_SIZE=${max_file_size}
- MAX_REQUEST_SIZE=${max_request_size}B
- CONNECTION_TIMEOUT=${connection_timeout:-10000}
- READ_TIMEOUT=${read_timeout:-60000}
compreface-fe:
restart: always
image: ${registry}compreface-fe:${FE_VERSION}
container_name: "compreface-ui"
ports:
- "8000:80"
depends_on:
- compreface-api
- compreface-admin
environment:
- CLIENT_MAX_BODY_SIZE=${max_request_size}
- PROXY_READ_TIMEOUT=${read_timeout:-60000}ms
- PROXY_CONNECT_TIMEOUT=${connection_timeout:-10000}ms
compreface-core:
restart: always
image: ${registry}compreface-core:${CORE_VERSION}
container_name: "compreface-core"
environment:
- ML_PORT=3000
- IMG_LENGTH_LIMIT=${max_detect_size}
- UWSGI_PROCESSES=${uwsgi_processes:-2}
- UWSGI_THREADS=${uwsgi_threads:-1}
healthcheck:
test: curl --fail http://localhost:3000/healthcheck || exit 1
interval: 10s
retries: 0
start_period: 0s
timeout: 1s
Comments powered by CComment