This commit is contained in:
Thomas
2026-03-08 14:44:50 +00:00
commit 22ba348284
17 changed files with 1674 additions and 0 deletions

29
Containerfile Normal file
View File

@@ -0,0 +1,29 @@
# --- Build stage ---
FROM docker.io/library/golang:1.25-alpine AS build
RUN apk add --no-cache gcc musl-dev
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 go build \
-ldflags='-s -w -extldflags "-static"' \
-tags 'netgo,osusergo' \
-trimpath \
-o /horchposten .
# --- Runtime stage ---
FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /horchposten /horchposten
EXPOSE 8080
VOLUME /data
ENV DB_PATH=/data/analytics.db
ENV ADDR=:8080
ENTRYPOINT ["/horchposten"]