summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorAlexander Kiryukhin <a.kiryukhin@mail.ru>2022-05-02 14:09:37 +0300
committerAlexander Kiryukhin <a.kiryukhin@mail.ru>2022-05-02 14:09:37 +0300
commit5a168928ea451010b97d06be686b1a1a2141b31d (patch)
tree27125d09f6f134b797853f8c85c5d7e723c4d5f0 /Dockerfile
parentcc3ae00bbbe3bd0e04d1821e4bb54a7d8545d0a3 (diff)
Dockerfile
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile19
1 files changed, 19 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..efa35cb
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,19 @@
+FROM golang:1.18 as builder
+WORKDIR /usr/src
+COPY go.mod .
+COPY go.sum .
+RUN go mod download
+COPY . .
+RUN go build -a -installsuffix cgo -o service .
+
+FROM alpine
+RUN apk update \
+ && apk upgrade \
+ && apk add --no-cache \
+ ca-certificates \
+ && update-ca-certificates 2>/dev/null || true
+WORKDIR /usr/app
+COPY --from=builder /usr/src/service .
+COPY static .
+COPY tpl .
+CMD ["./service"]