bazarr/dev-setup/docker-compose.yml
2025-10-12 13:53:47 -04:00

124 lines
3.7 KiB
YAML

# Bazarr Development Environment
#
# To start the full development environment:
# docker-compose up -d
#
# To include Autopulse for webhook testing:
# docker-compose --profile autopulse up -d
#
# To test specific Autopulse PR (e.g., PR #344 for config template API):
# 1. Edit the autopulse service args below to set AUTOPULSE_PR=344
# 2. docker-compose --profile autopulse up -d --build autopulse
#
services:
bazarr-backend:
build:
context: ..
dockerfile: dev-setup/Dockerfile.backend
container_name: bazarr-backend
ports:
- "6767:6767" # Bazarr backend API
volumes:
# Mount source code for live editing
- ../bazarr.py:/app/bazarr/bin/bazarr.py:ro
- ../bazarr:/app/bazarr/bin/bazarr:ro
- ../custom_libs:/app/bazarr/bin/custom_libs:ro
- ../libs:/app/bazarr/bin/libs:ro
- ../migrations:/app/bazarr/bin/migrations:ro
# Mount data directory for persistence
- ./data:/app/bazarr/data
environment:
- SZ_USER_AGENT=bazarr-dev
- BAZARR_VERSION=dev
- PYTHONPATH=/app/bazarr/bin/custom_libs:/app/bazarr/bin/libs:/app/bazarr/bin/bazarr:/app/bazarr/bin
restart: unless-stopped
networks:
- bazarr-network
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "6767"]
interval: 5s
timeout: 10s
retries: 20
start_period: 30s
bazarr-frontend:
build:
context: ..
dockerfile: dev-setup/Dockerfile.frontend
container_name: bazarr-frontend
ports:
- "5173:5173" # Vite frontend dev server
volumes:
# Mount frontend source code for live editing
- ../frontend/src:/app/src:ro
- ../frontend/public:/app/public:ro
- ../frontend/config:/app/config:ro
- ../frontend/vite.config.ts:/app/vite.config.ts:ro
- ../frontend/tsconfig.json:/app/tsconfig.json:ro
- ../frontend/package.json:/app/package.json:ro
- ../frontend/.env.development:/app/.env.development:ro
# Ensure node_modules is not overwritten by volume mount
- /app/node_modules
# Share data directory so frontend can read backend config
- ./data:/app/data
environment:
- NODE_ENV=development
- VITE_PROXY_URL=http://bazarr-backend:6767
- VITE_BAZARR_CONFIG_FILE=/app/data/config/config.yaml
- VITE_CAN_UPDATE=true
- VITE_HAS_UPDATE=false
- VITE_REACT_QUERY_DEVTOOLS=true
- VITE_API_KEY=bazarr # Set the API key to match config
depends_on:
- bazarr-backend
restart: unless-stopped
networks:
- bazarr-network
healthcheck:
test: ["CMD", "nc", "-z", "bazarr-backend", "6767"]
interval: 5s
timeout: 10s
retries: 30
start_period: 60s
# Autopulse service - configurable branch/PR
autopulse:
build:
context: ..
dockerfile: dev-setup/autopulse/Dockerfile
args:
# Use main branch by default, override with PR for testing
- AUTOPULSE_BRANCH=main
# Uncomment and set to test specific PRs:
# - AUTOPULSE_PR=344
container_name: bazarr-autopulse
restart: unless-stopped
ports:
- "2875:2875"
volumes:
- ./autopulse/config.yaml:/app/config.yaml:ro
- ./autopulse/data:/app/data
environment:
- AUTOPULSE__APP__DATABASE_URL=sqlite://data/autopulse.db
- RUST_LOG=info
networks:
- bazarr-network
profiles:
- autopulse # Use profile to make this service optional
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:2875/stats"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
bazarr-network:
driver: bridge
volumes:
bazarr-dev-data:
driver: local