# mindthemath/rmbg — runs the image built from the published (TestPyPI) package. services: rmbg: build: context: . dockerfile: Dockerfile image: mindthemath/rmbg:${TAG:-latest} container_name: rmbg ports: - "${PORT:-8000}:8000" environment: - NVIDIA_VISIBLE_DEVICES=all - NVIDIA_DRIVER_CAPABILITIES=compute,utility # Default variant/resolution; both are also selectable per request. - BIREFNET_MODEL=${BIREFNET_MODEL:-general} - BIREFNET_RESOLUTION=${BIREFNET_RESOLUTION:-1024} # Use the nvidia-container-runtime for GPU acceleration. runtime: nvidia volumes: # Persist downloaded BiRefNet weights across container restarts. - hf-cache:/app/hf_cache healthcheck: test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"] interval: 15s timeout: 5s retries: 30 start_period: 180s restart: unless-stopped volumes: hf-cache: