init: registry server + operator from VM

This commit is contained in:
“Naeel”
2026-07-01 17:37:08 +04:00
commit dd1007d24c
67 changed files with 3293 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
# Build Stage
FROM golang:1.24-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY cmd ./cmd
# Build statically
RUN CGO_ENABLED=0 GOOS=linux go build -o /operator cmd/main.go
# Run Stage
FROM alpine:3.19
WORKDIR /app
COPY --from=builder /operator /app/operator
USER 1000:1000
CMD ["/app/operator"]
+20
View File
@@ -0,0 +1,20 @@
# Build Stage
FROM golang:1.24-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
COPY registrykeys ./registrykeys
RUN go mod download
COPY cmd/registry ./cmd/registry
RUN CGO_ENABLED=0 GOOS=linux go build -o /registry-server ./cmd/registry
# Run Stage
FROM alpine:3.19
WORKDIR /app
COPY --from=builder /registry-server /app/registry-server
RUN apk add --no-cache ca-certificates
USER 1000:1000
EXPOSE 8080
CMD ["/app/registry-server"]
+23
View File
@@ -0,0 +1,23 @@
# Build Stage
FROM golang:1.24-alpine AS builder
WORKDIR /app
# Only copy what's needed for the registry server
COPY go.mod go.sum ./
RUN go mod download
COPY cmd/registry ./cmd/registry
# Build statically
RUN CGO_ENABLED=0 GOOS=linux go build -o /registry-server ./cmd/registry
# Run Stage
FROM alpine:3.19
WORKDIR /app
COPY --from=builder /registry-server /app/registry-server
# Registry server uses HTTPS for S3, so CA certs are good to have
RUN apk add --no-cache ca-certificates
USER 1000:1000
EXPOSE 8080
CMD ["/app/registry-server"]