summaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorColin Wilk <colin@wilk.cx>2026-10-30 10:04:02 +0100
committerColin Wilk <colin@wilk.cx>2026-10-30 10:07:43 +0100
commitb03b00869391cd70ef1e40561f72dffbd2f47b29 (patch)
treefd1941854bea58ec464b81ac8b0d8627cbed2e74 /Dockerfile
downloadcr-web-b03b00869391cd70ef1e40561f72dffbd2f47b29.tar.gz
cr-web-b03b00869391cd70ef1e40561f72dffbd2f47b29.zip
Initial Commit
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile24
1 files changed, 24 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..3405c1a
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,24 @@
+# --- Builder ---
+FROM golang:alpine AS builder
+WORKDIR /app
+COPY go.mod main.go ./
+COPY registry ./registry
+COPY web ./web
+RUN CGO_ENABLED=0 go build -o registry-browser .
+
+# --- Final Container ---
+FROM alpine:3.21
+
+RUN addgroup -S registry && adduser -S registry -G registry
+
+WORKDIR /app
+
+COPY --from=builder --chown=registry:registry /app/registry-browser /usr/local/bin/registry-browser
+COPY templates ./templates
+COPY assets ./assets
+
+USER registry
+
+EXPOSE 8080
+
+CMD ["registry-browser", "--http=0.0.0.0:8080"]