FROM docker.io/golang:1.24-alpine3.21 AS build ENV CGO_ENABLED=1 RUN apk add --no-cache gcc musl-dev WORKDIR /usr/src/app COPY go.mod go.sum ./ RUN go mod download COPY . . RUN go build -v \ -o /usr/local/bin/knotserver \ -ldflags='-s -w -extldflags "-static"' \ ./cmd/knotserver && \ go build -v \ -o /usr/local/bin/keyfetch \ ./cmd/keyfetch && \ go build -v \ -o /usr/local/bin/repoguard \ ./cmd/repoguard FROM docker.io/alpine:3.21 LABEL org.opencontainers.image.title=Tangled LABEL org.opencontainers.image.description="Tangled is a decentralized and open code collaboration platform, built on atproto." LABEL org.opencontainers.image.vendor=Tangled.sh LABEL org.opencontainers.image.licenses=MIT LABEL org.opencontainers.image.url=https://tangled.sh LABEL org.opencontainers.image.source=https://tangled.sh/@tangled.sh/core COPY --from=build /usr/local/bin/knotserver /usr/local/bin COPY --from=build /usr/local/bin/keyfetch /usr/local/bin COPY --from=build /usr/local/bin/repoguard /usr/local/bin EXPOSE 5555 CMD ["knotserver"]