22 lines
3.0 KiB
Markdown
22 lines
3.0 KiB
Markdown
# Infrastructure standard
|
|
|
|
Core application, ML, and monitoring use separate Compose projects. Start core first: ML and monitoring join its network. Starting core does not start either project. The code runner and LXD lab provisioner have separate host setup under deploy/labs/. The runner development container uses deploy/docker/docker-compose.runner.dev.yml.
|
|
|
|
Upstream container images use the requested moving `latest` or `alpine` tags where the image publishes them. These tags can change; read the current Compose and Dockerfile references instead of recording an old component version. Keep Go at exact version 1.26.9 in `go.mod`, toolchain declarations, and the backend build image. Application dependency lockfiles remain checked in and should not be removed when image tags float.
|
|
|
|
The core frontend container serves static assets with Nginx and proxies /api to Go. The default host binding is loopback at port 8080. This scaffold does not terminate production TLS. Grafana is also bound to loopback at port 3000.
|
|
|
|
The ML Compose file binds to 127.0.0.1:8000 by default and requires a shared ML_SERVICE_TOKEN. A remote ML host needs an explicit private bind address and restricted firewall rules. Leave ML_METRICS_TARGET empty when no ML scrape is configured; a nonempty target also needs bearer authentication in Prometheus because ML protects /metrics.
|
|
|
|
Start the core project before monitoring because monitoring joins its Docker network. The monitoring Compose project collects only the explicitly configured core services. Do not expose PostgreSQL, Redis, SeaweedFS, Kafka, backend metrics, Prometheus, Loki, exporters, or the Docker socket proxy publicly.
|
|
|
|
Redis runs in the core project with password authentication, bounded memory, allkeys-lru eviction, and persistence disabled. Keep it private to the Compose network. The separate monitoring project supplies redis-exporter; ML does not use Redis in the current scaffold.
|
|
|
|
Kafka runs in the core project as one internal KRaft broker and controller with a bounded JVM heap, a memory limit, and a named volume. Keep its listener private to the Compose network and create topics explicitly; it carries events only through the transactional outbox.
|
|
|
|
SeaweedFS runs as a single-node S3-compatible server in the core project. Persist both data and metadata in its named volume. Keep every storage port private; require credentials for S3 access. Nginx does not proxy private objects directly. Ordinary shutdown preserves the volume; this local setup does not provide HA or off-host backups.
|
|
|
|
Use the repository's Compose and observability Make targets to render and validate configuration. Keep secrets in a local .env or deployment secret store, not in committed examples. Do not claim TLS, public availability, multi-node reliability, or a successful deploy based on Compose syntax checks.
|
|
|
|
The PostgreSQL exporter role is created only by first-volume initialization when its optional credentials are present. Setting those values after the database volume already exists does not rerun initialization.
|