All checks were successful
release-tag / release-image (push) Successful in 2m5s
34 lines
1.2 KiB
Docker
34 lines
1.2 KiB
Docker
# syntax=docker/dockerfile:1.7
|
|
ARG GO_IMAGE=golang:1.26-alpine
|
|
FROM ${GO_IMAGE} AS build
|
|
WORKDIR /src
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
COPY go.mod ./
|
|
COPY .env.example ./.env.example
|
|
COPY third_party ./third_party
|
|
COPY cmd ./cmd
|
|
COPY internal ./internal
|
|
COPY web ./web
|
|
RUN CGO_ENABLED=0 GOOS=linux go test ./... && \
|
|
CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/ai-disclosure ./cmd/server
|
|
|
|
FROM scratch
|
|
ARG VERSION=2.0.3
|
|
ARG REVISION=unknown
|
|
ARG CREATED=unknown
|
|
LABEL org.opencontainers.image.title="AI Disclosure Standard" \
|
|
org.opencontainers.image.description="Open, multilingual AI usage disclosure service with optional licensed operational capabilities" \
|
|
org.opencontainers.image.version="${VERSION}" \
|
|
org.opencontainers.image.revision="${REVISION}" \
|
|
org.opencontainers.image.created="${CREATED}" \
|
|
org.opencontainers.image.licenses="MIT"
|
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
|
|
COPY --from=build /out/ai-disclosure /ai-disclosure
|
|
USER 65532:65532
|
|
EXPOSE 8080
|
|
ENV LISTEN_ADDRESS=:8080 \
|
|
SERVICE_MODE=full \
|
|
LICENSE_CACHE_FILE=/data/license-lease.json
|
|
ENTRYPOINT ["/ai-disclosure"]
|