add dockerfile
This commit is contained in:
parent
5a940f0297
commit
9e270ed1c6
13
Dockerfile
Normal file
13
Dockerfile
Normal file
@ -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"]
|
1
main.go
1
main.go
@ -21,6 +21,7 @@ var GitCommit string
|
|||||||
func main() {
|
func main() {
|
||||||
conf, err := mbl.LoadMatrixClientConfig("config.yaml")
|
conf, err := mbl.LoadMatrixClientConfig("config.yaml")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Println("no local config found, checking /etc/nunbot")
|
||||||
conf, err = mbl.LoadMatrixClientConfig("/etc/nunbot/config.yaml")
|
conf, err = mbl.LoadMatrixClientConfig("/etc/nunbot/config.yaml")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user