summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-08-28 13:47:44 +0300
committerAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-08-28 13:47:44 +0300
commit459b87480e76d9be275b0ee8a30e4b691af8aaba (patch)
tree6981c676d5c52c955240b464601d9311fb30a888 /Dockerfile
initial
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile20
1 files changed, 20 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..1035e2b
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,20 @@
+# syntax=docker/dockerfile:1
+FROM gitrepo.ru/base/go:latest AS go
+
+COPY go.mod go.sum ./
+
+RUN go mod download
+
+COPY . .
+
+RUN go generate && CGO_ENABLED=0 GOOS=linux go build -o nixshare
+
+FROM scratch
+
+WORKDIR /app
+
+COPY --from=go /app/nixshare ./nixshare
+
+EXPOSE 8000
+
+CMD ["./nixshare"] \ No newline at end of file