initial
This commit is contained in:
29
Containerfile
Normal file
29
Containerfile
Normal 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"]
|
||||
Reference in New Issue
Block a user