services: # -- NATS Server ---------------------------- nats: image: nats:latest profiles: ["nats"] ports: - "4222:4222" - "8222:8222" command: > --auth ${NATS_TOKEN:-realsense-dev-token} --http_port 8222 restart: unless-stopped healthcheck: test: ["CMD", "nats-server", "--help"] interval: 5s timeout: 3s retries: 3 start_period: 5s # -- Backend -------------------------------- backend: build: context: . dockerfile: Dockerfile # network: host so that build-time apt/git/pip can reach the # tinyproxy running on the host at localhost:8888. network: host privileged: true ports: - "${API_PORT:-8878}:8878" devices: - "/dev/bus/usb:/dev/bus/usb" volumes: - ./images:/app/images - ./models:/app/models:ro env_file: .env depends_on: nats: condition: service_healthy required: false restart: unless-stopped healthcheck: test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8878/api/health')"] interval: 10s timeout: 5s retries: 3 # -- Frontend React Dev (hot reload) -------- frontend-dev: image: node:20-alpine working_dir: /app volumes: - ./src/frontend/react:/app - /app/node_modules command: sh -c "npm ci && npm run dev -- --host 0.0.0.0" ports: - "5173:5173" profiles: [dev]