first commit

This commit is contained in:
2026-01-26 12:40:47 +11:00
commit adaa57f9e2
17 changed files with 1382 additions and 0 deletions

34
Dockerfile Normal file
View File

@@ -0,0 +1,34 @@
# ---- build stage ----
FROM golang:1.25-alpine AS build
WORKDIR /src
# Git CA certs (for go modules / HTTPS)
RUN apk add --no-cache ca-certificates
# Copy mod files first for better caching
COPY go.mod go.sum ./
RUN go mod download
# Copy the rest of the source
COPY . .
# Build a static-ish binary (alpine musl)
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -trimpath -ldflags="-s -w" -o /out/ingestd ./cmd/ingestd
# ---- runtime stage ----
FROM alpine:3.22
WORKDIR /app
RUN apk add --no-cache ca-certificates && \
adduser -D -H -u 10001 appuser
# Copy binary + schema file used at startup
COPY --from=build /out/ingestd /app/ingestd
COPY internal/db/schema.sql /app/internal/db/schema.sql
USER appuser
# default config path inside container
ENTRYPOINT ["/app/ingestd"]
CMD ["-config", "/app/config.yaml"]