Files
schemas/Dockerfile
T
renovate 19b7f0edb6
Release / release (push) Successful in 1m36s
schemas / vulnerabilities (push) Successful in 3m25s
schemas / check-release (push) Successful in 5m10s
schemas / check (push) Successful in 6m21s
pre-commit / pre-commit (push) Successful in 11m40s
schemas / build (push) Successful in 6m36s
schemas / deploy-prod (push) Successful in 1m13s
chore(deps): update node.js to 7fddd9d (#739)
2026-02-25 06:26:07 +00:00

41 lines
1.4 KiB
Docker

FROM amd64/golang:1.26.0@sha256:9835fb4f8aa06038ca460e300ee3cb8079d0802a1979724cdb455f5784448704 as modules
WORKDIR /build
ADD go.* /build
RUN go mod download
FROM modules as build
ARG CI_COMMIT
WORKDIR /build
ENV CGO_ENABLED=0
ADD . /build
RUN CGO_ENABLED=1 go test -mod=readonly -race -coverprofile=coverage.txt.tmp -covermode=atomic -coverpkg=$(go list ./... | tr '\n' , | sed 's/,$//') ./...
RUN ["/bin/bash", "-c", "cat coverage.txt.tmp | grep -v testing.go | grep -v -f <(find . -type f | xargs grep -l 'Code generated by github.com/99designs/gqlgen, DO NOT EDIT') > coverage.txt"]
RUN go tool cover -html=coverage.txt -o coverage.html
RUN go tool cover -func=coverage.txt
RUN rm coverage.txt.tmp
RUN GOOS=linux GOARCH=amd64 go build \
-a -installsuffix cgo \
-mod=readonly \
-o /release/service \
-ldflags "-w -s -X main.buildVersion=${CI_COMMIT}" \
./cmd/service/service.go
FROM scratch as export
COPY --from=build /build/coverage.txt /
FROM node:24.14.0-alpine@sha256:7fddd9ddeae8196abf4a3ef2de34e11f7b1a722119f91f28ddf1e99dcafdf114
ENV TZ Europe/Stockholm
# Install wgc CLI globally for Cosmo Router composition
RUN npm install -g wgc@latest
# Copy timezone data and certificates
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
# Copy the service binary
COPY --from=build /release/service /
CMD ["/service"]