about summary refs log tree commit diff stats
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile34
1 files changed, 34 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..2b5da4b
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,34 @@
+# Build
+FROM golang:alpine AS build
+
+ENV CGO_ENABLED=0
+
+RUN apk add --no-cache -U build-base git make
+
+RUN mkdir -p /src
+
+WORKDIR /src
+
+# Copy Makefile
+COPY Makefile ./
+
+# Install deps
+RUN make deps
+
+# Copy content
+COPY . .
+
+# Build the site
+RUN make build
+
+# Runtime
+FROM scratch
+
+WORKDIR /
+VOLUME /data
+
+COPY --from=build /go/bin/static /static
+COPY --from=build /src/.pub /data
+
+ENTRYPOINT ["/static"]
+CMD ["-r", "/data"]