# CVLab-Kit Docker Compose # # Directory structure (on host): # /volume1/docker/cvlab-kit/ # ├── compose.yml # This file # ├── data/ # Persistent data (NEVER delete) # │ ├── logs/ # Run logs # │ ├── queue_logs/ # Experiment logs # │ └── state/ # DB and JSON state files # └── src/ # Source code (can delete & re-clone) # # First time setup: # mkdir -p /volume1/docker/cvlab-kit/{data/logs,data/queue_logs,data/state,src} # docker compose up -d # # Update code: # docker compose restart services: cvlab-kit: image: python:3.10-slim container_name: cvlab-kit ports: - "8000:8000" volumes: - /volume1/docker/cvlab-kit/src:/app - /volume1/docker/cvlab-kit/data/logs:/app/logs - /volume1/docker/cvlab-kit/data/queue_logs:/app/web_helper/queue_logs - /volume1/docker/cvlab-kit/data/state:/app/web_helper/state working_dir: /app command: - bash - -c - | set -ex # Install system dependencies apt-get update -qq apt-get install -y -qq git curl build-essential >/dev/null # Install Node.js if not present if ! command -v node > /dev/null; then curl -fsSL https://deb.nodesource.com/setup_18.x | bash - >/dev/null apt-get install -y -qq nodejs >/dev/null fi # Install uv pip install -q uv # Clone or update repository if [ ! -f /app/pyproject.toml ]; then echo '=== First time setup ===' rm -rf /tmp/cvlab-clone git clone --depth 1 https://github.com/deveronica/cvlab-kit.git /tmp/cvlab-clone cd /tmp/cvlab-clone tar --exclude='logs' --exclude='web_helper/queue_logs' --exclude='web_helper/state' -cf - . | tar -xf - -C /app rm -rf /tmp/cvlab-clone else echo '=== Updating code ===' cd /app git fetch origin main git reset --hard origin/main fi cd /app # Python dependencies echo '=== Installing Python dependencies ===' uv sync --frozen # Frontend build echo '=== Building frontend ===' cd /app/web_helper/frontend npm ci npm run build cd /app # Verify echo '=== Verification ===' ls -la /app/app.py ls -la /app/web_helper/frontend/dist/ # Start server echo '=== Starting server ===' exec uv run app.py --server-only restart: unless-stopped