All checks were successful
release-tag / release-image (push) Successful in 2m5s
37 lines
1.3 KiB
Docker
37 lines
1.3 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 Bulk" \
|
|
org.opencontainers.image.description="Licensed bulk workspace and API for professional AI usage declaration processing" \
|
|
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=bulk \
|
|
REQUIRE_LICENSE=true \
|
|
BULK_REQUIRE_API_KEY=true \
|
|
API_ALLOWED_ORIGIN= \
|
|
LICENSE_CACHE_FILE=/data/license-lease.json
|
|
ENTRYPOINT ["/ai-disclosure"]
|