From 9e270ed1c664e887e8df31956670d508fb77ecb1 Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 3 Aug 2022 15:40:19 -0400 Subject: [PATCH] add dockerfile --- Dockerfile | 13 +++++++++++++ main.go | 1 + 2 files changed, 14 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d248a6c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM golang:1.18 as builder +WORKDIR /go/src/app +COPY . . +RUN apt update && apt upgrade -y +RUN go build + +FROM alpine:latest as final +WORKDIR /srv/ +RUN mkdir /srv/nunbot +RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 +COPY --from=builder /go/src/app/nunbot /srv/nunbot/ + +CMD ["/srv/nunbot/nunbot"] diff --git a/main.go b/main.go index de45fb2..34fa03f 100644 --- a/main.go +++ b/main.go @@ -21,6 +21,7 @@ var GitCommit string func main() { conf, err := mbl.LoadMatrixClientConfig("config.yaml") if err != nil { + log.Println("no local config found, checking /etc/nunbot") conf, err = mbl.LoadMatrixClientConfig("/etc/nunbot/config.yaml") if err != nil { panic(err)