From ee259c569c8acd9d994ad5e036d256b67ed659ab Mon Sep 17 00:00:00 2001 From: David Florness Date: Sun, 31 Oct 2021 15:26:40 -0400 Subject: [PATCH] contrib: add simple Dockerfile and docker-compose.yml example files --- contrib/.dockerignore | 2 ++ contrib/Dockerfile | 17 +++++++++++++++++ contrib/README.md | 10 ++++++++++ contrib/docker-compose.yml | 18 ++++++++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 contrib/.dockerignore create mode 100644 contrib/Dockerfile create mode 100644 contrib/README.md create mode 100644 contrib/docker-compose.yml diff --git a/contrib/.dockerignore b/contrib/.dockerignore new file mode 100644 index 0000000..781dc31 --- /dev/null +++ b/contrib/.dockerignore @@ -0,0 +1,2 @@ +docker-compose.yml +README.md diff --git a/contrib/Dockerfile b/contrib/Dockerfile new file mode 100644 index 0000000..2c2311d --- /dev/null +++ b/contrib/Dockerfile @@ -0,0 +1,17 @@ +FROM alpine AS builder + +RUN apk update +RUN apk add go olm-dev g++ +RUN go install git.hnitbjorg.xyz/~edwargix/msc-link-bot@latest + +FROM alpine + +COPY --from=builder /root/go/bin/msc-link-bot /usr/local/bin/msc-link-bot +RUN apk add olm && \ + adduser -h /msclinkbot -S msclinkbot + +USER msclinkbot +VOLUME /msclinkbot +WORKDIR /msclinkbot + +CMD /usr/local/bin/msc-link-bot diff --git a/contrib/README.md b/contrib/README.md new file mode 100644 index 0000000..980458a --- /dev/null +++ b/contrib/README.md @@ -0,0 +1,10 @@ +# contrib + +This directory contains various files that those looking to run/deploy +`msc-link-bot` may find useful. + +- `Dockerfile` --- a simple Dockerfile that builds and runs `msc-link-bot` in a + docker image +- `docker-compose.yml` --- a simple [compose](https://docs.docker.com/compose/) + file that sets up the volume and environment variable needed to fully run the + `Dockerfile` image diff --git a/contrib/docker-compose.yml b/contrib/docker-compose.yml new file mode 100644 index 0000000..22b73e3 --- /dev/null +++ b/contrib/docker-compose.yml @@ -0,0 +1,18 @@ +version: "3" + +services: + msclinkbot: + build: . + environment: + HOMESERVER: https://matrix.example.org + USER_ID: '@msclinkbot:example.org' + # these values can be generated with + # https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-login + DEVICE_ID: 'FWQXHAAVLF' + ACCESS_TOKEN: '' + volumes: + # needed to retain crypto.db + - msclinkbot:/msclinkbot + +volumes: + msclinkbot: -- 2.38.4