Download docker-compose.yml from ASown/agent-iot: direct link, hf CLI and curl.
- Browser
- Download file 3.65 kB
-
https://huggingface.co/spaces/ASown/agent-iot/resolve/main/docker-compose.yml
- Command line
-
hf download hf://spaces/ASown/agent-iot/docker-compose.yml
-
curl -L -o docker-compose.yml https://huggingface.co/spaces/ASown/agent-iot/resolve/main/docker-compose.yml
3.65 kB
| # Maker harness — hạ tầng đầy đủ (atria-style), thêm dần theo từng phase. | |
| # Phase 3: db + adminer. Phase 4 thêm redis. Phase 5 thêm keycloak. Phase 6 thêm app. | |
| # | |
| # Chạy hybrid (khuyến nghị cho dev Windows/Playwright): chỉ bật hạ tầng rồi chạy | |
| # app trên host bằng .\web.ps1 với DATABASE_URL trỏ localhost: | |
| # docker compose up -d db adminer | |
| # $env:DATABASE_URL="postgresql://maker:maker@localhost:5432/maker"; .\web.ps1 | |
| services: | |
| db: | |
| image: postgres:16-alpine | |
| restart: unless-stopped | |
| environment: | |
| - POSTGRES_DB=maker | |
| - POSTGRES_USER=maker | |
| - POSTGRES_PASSWORD=maker | |
| ports: | |
| - "5432:5432" | |
| volumes: | |
| - postgres_data:/var/lib/postgresql/data | |
| - ./schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro | |
| healthcheck: | |
| test: ["CMD-SHELL", "pg_isready -U maker -d maker"] | |
| interval: 5s | |
| timeout: 5s | |
| retries: 5 | |
| adminer: | |
| image: adminer:latest | |
| restart: unless-stopped | |
| ports: | |
| - "8081:8080" | |
| environment: | |
| - ADMINER_DEFAULT_SERVER=db | |
| depends_on: | |
| db: | |
| condition: service_healthy | |
| # Redis — bus step events (Phase 4). App tự degrade in-memory nếu vắng. | |
| redis: | |
| image: redis:7-alpine | |
| restart: unless-stopped | |
| ports: | |
| - "6379:6379" | |
| healthcheck: | |
| test: ["CMD", "redis-cli", "ping"] | |
| interval: 5s | |
| timeout: 3s | |
| retries: 10 | |
| # App — maker harness (Phase 6). Trỏ vào db/redis/keycloak nội bộ compose. | |
| # Single worker cố ý (1 Chromium + serialize tool). Không bật service này nếu | |
| # chạy hybrid (app trên host) — dùng `docker compose up -d db redis keycloak`. | |
| app: | |
| build: . | |
| restart: unless-stopped | |
| ports: | |
| - "8080:8080" | |
| environment: | |
| - GROQ_API_KEY=${GROQ_API_KEY} | |
| - HARNESS_MODEL=${HARNESS_MODEL:-gpt-oss-120b} | |
| - CNC_HEADLESS=1 | |
| - DATABASE_URL=${DATABASE_URL:-postgresql://maker:maker@db:5432/maker} | |
| - REDIS_URL=${REDIS_URL:-redis://redis:6379/0} | |
| - AUTH_MODE=${AUTH_MODE:-keycloak} | |
| - SESSION_SECRET=${SESSION_SECRET:-dev-maker-secret-change-me} | |
| - KEYCLOAK_URL=http://keycloak:8080 | |
| - KEYCLOAK_PUBLIC_URL=${KEYCLOAK_PUBLIC_URL:-http://localhost:8082} | |
| - KEYCLOAK_REALM=maker | |
| - KEYCLOAK_CLIENT_ID=maker-web | |
| volumes: | |
| - ./modules:/app/modules # sửa/thêm module không cần build lại | |
| - maker_var:/app/var # uploads + output runtime | |
| healthcheck: | |
| test: ["CMD", "curl", "-fsS", "http://localhost:8080/healthz"] | |
| interval: 15s | |
| timeout: 5s | |
| retries: 5 | |
| start_period: 40s | |
| depends_on: | |
| db: | |
| condition: service_healthy | |
| redis: | |
| condition: service_healthy | |
| keycloak: | |
| condition: service_started | |
| # Keycloak — auth OIDC (Phase 5). Dùng chung Postgres (DB 'keycloak' tạo bởi | |
| # schema.sql). App chỉ cần khi AUTH_MODE=keycloak; realm 'maker' import lúc start. | |
| keycloak: | |
| image: quay.io/keycloak/keycloak:26.0 | |
| restart: unless-stopped | |
| command: ["start-dev", "--import-realm"] | |
| environment: | |
| - KC_DB=postgres | |
| - KC_DB_URL=jdbc:postgresql://db:5432/keycloak | |
| - KC_DB_USERNAME=maker | |
| - KC_DB_PASSWORD=maker | |
| - KC_HOSTNAME=localhost | |
| - KC_HTTP_ENABLED=true | |
| - KEYCLOAK_ADMIN=admin | |
| - KEYCLOAK_ADMIN_PASSWORD=${KEYCLOAK_ADMIN_PASSWORD:-admin} | |
| ports: | |
| - "8082:8080" | |
| volumes: | |
| - ./keycloak/realm-export.json:/opt/keycloak/data/import/realm-export.json:ro | |
| depends_on: | |
| db: | |
| condition: service_healthy | |
| volumes: | |
| postgres_data: | |
| maker_var: | |