Files
madbase/Dockerfile
Vlad Durnea 0179cc285d
Some checks failed
CI/CD Pipeline / lint (push) Successful in 3m45s
CI/CD Pipeline / integration-tests (push) Failing after 57s
CI/CD Pipeline / unit-tests (push) Failing after 1m1s
CI/CD Pipeline / e2e-tests (push) Has been skipped
CI/CD Pipeline / build (push) Has been skipped
M1 foundation: fix proxy, pool HTTP clients, split services, add ApiError + RLS
- Fix proxy body forwarding, round-robin load balancing, response streaming
- Pool reqwest::Client in proxy, control, and gateway (no per-request alloc)
- Harden CORS in gateway/main.rs (was allow_origin(Any), now uses ALLOWED_ORIGINS)
- Add common/src/error.rs: ApiError type with structured JSON responses
- Add common/src/rls.rs: RlsTransaction extractor for deduplicated RLS setup
- Fix tracing in all standalone binaries (EnvFilter instead of unused var)
- Dockerfile multi-stage: separate worker-runtime, control-runtime, proxy-runtime targets
- docker-compose.yml: split into worker/system/proxy services with health checks
- Fix Grafana port mapping in pillar-system (3030:3000)
- Add config/prometheus.yml and config/vmagent.yml
- Add .env.example with all required variables
- 55 tests pass (49 run + 6 ignored integration tests requiring external services)

Made-with: Cursor
2026-03-15 13:38:49 +02:00

33 lines
1.6 KiB
Docker

# ── Builder stage ──────────────────────────────────────────────
FROM rust:latest AS builder
WORKDIR /app
COPY . .
RUN cargo build --release --workspace --jobs 2
# ── Runtime base (shared) ─────────────────────────────────────
FROM debian:trixie-slim AS runtime-base
RUN apt-get update && apt-get install -y libssl-dev ca-certificates && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# ── Gateway (monolithic — backward compat) ────────────────────
FROM runtime-base AS gateway
COPY --from=builder /app/target/release/gateway .
COPY web ./web
CMD ["./gateway"]
# ── Worker ────────────────────────────────────────────────────
FROM runtime-base AS worker-runtime
COPY --from=builder /app/target/release/worker .
CMD ["./worker"]
# ── Control Plane ─────────────────────────────────────────────
FROM runtime-base AS control-runtime
COPY --from=builder /app/target/release/control .
COPY web ./web
CMD ["./control"]
# ── Proxy ─────────────────────────────────────────────────────
FROM runtime-base AS proxy-runtime
COPY --from=builder /app/target/release/proxy .
CMD ["./proxy"]