From 7f0ca0f9d06377ba445eef7791272d8010a8bc97 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Mon, 9 Feb 2026 15:38:29 +0100 Subject: [PATCH] Add Dockerfile and move ingest service Containerize the telemetry ingest service and reorganize source layout. Added misc/data/Dockerfile with a multi-stage build (golang:1.23-alpine -> alpine:3.23) to produce /app/telemetry-ingest, run as a non-root user, expose :8080, and provide default env vars for configuration (LISTEN_ADDR, MAX_BODY_BYTES, RATE_LIMIT_RPM, RATE_BURST, RATE_KEY_MODE, ENABLE_REQUEST_LOGGING, UPSTREAM_TIMEOUT_MS). Renamed misc/ingest.go to misc/data/service.go to reflect the new directory structure. --- misc/data/Dockerfile | 21 +++++++++++++++++++++ misc/{ingest.go => data/service.go} | 0 2 files changed, 21 insertions(+) create mode 100644 misc/data/Dockerfile rename misc/{ingest.go => data/service.go} (100%) diff --git a/misc/data/Dockerfile b/misc/data/Dockerfile new file mode 100644 index 000000000..f947b3a2d --- /dev/null +++ b/misc/data/Dockerfile @@ -0,0 +1,21 @@ +# build stage +FROM golang:1.23-alpine AS build +WORKDIR /src +COPY . . +RUN go build -trimpath -ldflags "-s -w" -o /out/telemetry-ingest ./main.go + +# runtime stage +FROM alpine:3.23 +RUN adduser -D -H -s /sbin/nologin app +USER app +WORKDIR /app +COPY --from=build /out/telemetry-ingest /app/telemetry-ingest +EXPOSE 8080 +ENV LISTEN_ADDR=":8080" \ + MAX_BODY_BYTES="1024" \ + RATE_LIMIT_RPM="60" \ + RATE_BURST="20" \ + RATE_KEY_MODE="ip" \ + ENABLE_REQUEST_LOGGING="false" \ + UPSTREAM_TIMEOUT_MS="4000" +CMD ["/app/telemetry-ingest"] diff --git a/misc/ingest.go b/misc/data/service.go similarity index 100% rename from misc/ingest.go rename to misc/data/service.go