services: qwen-vllm: build: context: . dockerfile: Dockerfile container_name: qwen3-vl-4b-instruct restart: unless-stopped ports: - "8000:8000" # vLLM API - "8501:8501" # Streamlit UI environment: - HF_HOME=/root/.cache/huggingface - VLLM_WORKER_MULTIPROC_METHOD=spawn # Optional: Add HuggingFace token if model requires authentication # - HF_TOKEN=your_token_here volumes: # Mount HuggingFace cache to persist model - huggingface_cache:/root/.cache/huggingface # Mount custom configs if needed - ./config:/app/config:ro deploy: resources: reservations: devices: - driver: nvidia count: all capabilities: [gpu] runtime: nvidia shm_size: '16gb' # Shared memory for PyTorch dataloader workers ipc: host # Host IPC for better performance stdin_open: true tty: true volumes: huggingface_cache: driver: local networks: default: name: qwen-vllm-network