summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile23
1 files changed, 23 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..089bd0f
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,23 @@
+FROM reg.nx.kroot.sh/makko AS builder-makko
+
+WORKDIR /src
+COPY blog/ blog/
+COPY templates/ templates/
+COPY makko.json .
+
+RUN makko .
+
+FROM golang:alpine AS builder-go
+
+WORKDIR /src
+COPY server/go.mod server/main.go ./
+COPY --from=builder-makko /src/web ./static/
+
+RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /blog-server .
+
+FROM scratch
+
+COPY --from=builder-go /blog-server /blog-server
+
+EXPOSE 8080
+ENTRYPOINT ["/blog-server"]