~edwargix/msc-link-bot

ee259c569c8acd9d994ad5e036d256b67ed659ab — David Florness 3 years ago 6cc9924
contrib: add simple Dockerfile and docker-compose.yml example files
4 files changed, 47 insertions(+), 0 deletions(-)

A contrib/.dockerignore
A contrib/Dockerfile
A contrib/README.md
A contrib/docker-compose.yml
A contrib/.dockerignore => contrib/.dockerignore +2 -0
@@ 0,0 1,2 @@
docker-compose.yml
README.md

A contrib/Dockerfile => contrib/Dockerfile +17 -0
@@ 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

A contrib/README.md => contrib/README.md +10 -0
@@ 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

A contrib/docker-compose.yml => contrib/docker-compose.yml +18 -0
@@ 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: '<super_secret_access_token>'
    volumes:
      # needed to retain crypto.db
      - msclinkbot:/msclinkbot

volumes:
  msclinkbot: