Create Compose File
docker-compose.yml
version: '3.8' services: costgraph-agent: image: ghcr.io/baselinehq/costgraph-agent:latest container_name: costgraph-agent restart: unless-stopped ports: - "9090:9090" environment: - API_KEY=your-api-key - INSTANCE_NAME=my-vm - PROMETHEUS_ENDPOINT=http://localhost:9090 - METRICS_PORT=9090 - LOG_LEVEL=info volumes: - ./config:/etc/costgraph networks: - costgraph-network # Optional: Add Prometheus for local metrics collection prometheus: image: prom/prometheus:latest container_name: prometheus restart: unless-stopped ports: - "9091:9090" volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml networks: - costgraph-network networks: costgraph-network: driver: bridge
Start Services
# Start all services docker-compose up -d # Check service status docker-compose ps # View logs docker-compose logs -f costgraph-agent
Verify Deployment
# Check container status docker ps | grep costgraph-agent # Verify metrics endpoint curl http://localhost:9090/metrics # View logs for troubleshooting docker logs costgraph-agent