summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authora73x <[email protected]>2024-08-25 15:14:41 +0100
committera73x <[email protected]>2024-08-25 15:14:41 +0100
commit794401aaadfaa4efd91587db40439226231ff303 (patch)
tree241c3e5b975e0bbbeb68c52cd641ac5014848cd2 /Dockerfile
initial commit
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile16
1 files changed, 16 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..7b372e0
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,16 @@
+FROM golang:1.22 as builder
+
+WORKDIR /usr/src/app
+
+COPY go.mod go.sum ./
+RUN go mod download && go mod verify
+
+COPY . .
+
+RUN CGO_ENABLED=0 go build -ldflags "-s -w" -o /bin/site .
+
+FROM scratch
+COPY --from=builder /bin/site /app
+
+ENTRYPOINT ["/app"]
+