From 800aae90906b029c0885183b4c43903946317c66 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 21 Dec 2020 01:54:14 +0100 Subject: [PATCH] Add Dockerfile --- Dockerfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6dc75d0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM golang:alpine as builder + +COPY . /go/src/github.com/Luzifer/twitch-bot +WORKDIR /go/src/github.com/Luzifer/twitch-bot + +RUN set -ex \ + && apk add --update git \ + && go install \ + -ldflags "-X main.version=$(git describe --tags --always || echo dev)" \ + -mod=readonly + +FROM alpine:latest + +LABEL maintainer "Knut Ahlers " + +ENV CONFIG=/data/config.yaml \ + STORAGE_FILE=/data/store.json.gz + +RUN set -ex \ + && apk --no-cache add \ + ca-certificates + +COPY --from=builder /go/bin/twitch-bot /usr/local/bin/twitch-bot + +VOLUME ["/data"] + +ENTRYPOINT ["/usr/local/bin/twitch-bot"] +CMD ["--"] + +# vim: set ft=Dockerfile: