152 lines
3.7 KiB
YAML
152 lines
3.7 KiB
YAML
services:
|
|
mariadb:
|
|
image: mariadb:10.11
|
|
container_name: videodetect-mariadb
|
|
restart: unless-stopped
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-rootpass}
|
|
MYSQL_DATABASE: videodetect
|
|
MYSQL_USER: videodetect
|
|
MYSQL_PASSWORD: ${DB_PASSWORD:-videodetect123}
|
|
ports:
|
|
- "3306:3306"
|
|
volumes:
|
|
- mariadb_data:/var/lib/mysql
|
|
- ./db/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql:ro
|
|
networks:
|
|
- videodetect-network
|
|
healthcheck:
|
|
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 2G
|
|
|
|
worker:
|
|
build:
|
|
context: .
|
|
dockerfile: worker/Dockerfile
|
|
container_name: videodetect-worker
|
|
restart: unless-stopped
|
|
environment:
|
|
- NVIDIA_VISIBLE_DEVICES=all
|
|
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
|
- DB_HOST=mariadb
|
|
- DB_PORT=3306
|
|
- DB_NAME=videodetect
|
|
- DB_USER=videodetect
|
|
- DB_PASSWORD=${DB_PASSWORD:-videodetect123}
|
|
- CONFIG_PATH=/app/config.yaml
|
|
volumes:
|
|
- /dev/null:/dev/null # tmpfs mounted at /scratch in container
|
|
- nas_input:/data/input:ro
|
|
- ${NAS_OUTPUT_PATH:-./output}:/data/output
|
|
- ${MODELS_PATH:-./models}:/models
|
|
- ${TRAINING_PATH:-./training}:/data/training
|
|
tmpfs:
|
|
- /scratch:noexec,nosuid,size=100G
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: all
|
|
capabilities: ["gpu"]
|
|
limits:
|
|
memory: 24G
|
|
networks:
|
|
- videodetect-network
|
|
healthcheck:
|
|
test: ["CMD", "python3", "-c", "import torch; print(torch.cuda.is_available())"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
|
|
ui:
|
|
build:
|
|
context: ./ui
|
|
dockerfile: Dockerfile
|
|
container_name: videodetect-ui
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5000:5000"
|
|
environment:
|
|
- DB_HOST=mariadb
|
|
- DB_PORT=3306
|
|
- DB_NAME=videodetect
|
|
- DB_USER=videodetect
|
|
- DB_PASSWORD=${DB_PASSWORD:-videodetect123}
|
|
- FLASK_ENV=production
|
|
volumes:
|
|
- ./ui:/app
|
|
- nas_input:/data/input:ro
|
|
- ${NAS_OUTPUT_PATH:-/mnt/nas/output}:/data/output
|
|
networks:
|
|
- videodetect-network
|
|
depends_on:
|
|
mariadb:
|
|
condition: service_healthy
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 512M
|
|
|
|
prometheus:
|
|
image: prom/prometheus:v2.48.0
|
|
container_name: videodetect-prometheus
|
|
restart: unless-stopped
|
|
ports:
|
|
- "9090:9090"
|
|
volumes:
|
|
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
|
- prometheus_data:/prometheus
|
|
networks:
|
|
- videodetect-network
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 1G
|
|
|
|
grafana:
|
|
image: grafana/grafana:10.2.0
|
|
container_name: videodetect-grafana
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin}
|
|
- GF_USERS_ALLOW_SIGN_UP=false
|
|
volumes:
|
|
- grafana_data:/var/lib/grafana
|
|
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
|
|
networks:
|
|
- videodetect-network
|
|
depends_on:
|
|
- prometheus
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 512M
|
|
|
|
volumes:
|
|
mariadb_data:
|
|
driver: local
|
|
prometheus_data:
|
|
driver: local
|
|
grafana_data:
|
|
driver: local
|
|
nas_input:
|
|
driver: local
|
|
driver_opts:
|
|
type: nfs
|
|
o: addr=10.0.0.2,ro,nfsvers=4,hard,intr
|
|
device: ":/mnt/Bulk/Homes/ryan/Prawns"
|
|
|
|
networks:
|
|
videodetect-network:
|
|
driver: bridge
|