From 76743ac1c6ca935244c4242b8b44f6738a2bcc03 Mon Sep 17 00:00:00 2001 From: Louise de Beaufort Date: Tue, 20 Aug 2019 12:38:53 +0200 Subject: [PATCH 1/3] Add a Dockerfile and instructions to run with Docker --- Dockerfile | 12 ++++++++++++ README.md | 10 ++++++++++ 2 files changed, 22 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..922d95a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3-alpine +WORKDIR /workdir +RUN apk add alpine-sdk autoconf automake libtool gcc + +ADD relay /workdir/relay +ADD requirements.txt /workdir/ +RUN pip3 install -r requirements.txt + +ADD relay.yaml /workdir/ +CMD ["python", "-m", "relay"] + +VOLUME ["/workdir/data"] diff --git a/README.md b/README.md index 90bc89b..a52af9f 100644 --- a/README.md +++ b/README.md @@ -69,3 +69,13 @@ This will show the available management tasks: When following remote relays, you should use the `/actor` endpoint as you would in Pleroma and other LitePub-compliant software. + +## Docker + +You can run ActivityRelay with docker. Edit `relay.yaml` so that the database +location is set to `./data/relay.jsonld` and then build and run the docker +image : + + $ docker volume create activityrelay-data + $ docker build -t activityrelay . + $ docker run -d -p 8080:8080 -v activityrelay-data:/workdir/data activityrelay From 1fb8ca9ffcd8a866b2f568edb33de283a6d644b7 Mon Sep 17 00:00:00 2001 From: Louise de Beaufort Date: Tue, 20 Aug 2019 12:39:18 +0200 Subject: [PATCH 2/3] Add config file to gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 18f9b3b..fc8aedd 100644 --- a/.gitignore +++ b/.gitignore @@ -96,3 +96,6 @@ ENV/ viera.yaml viera.jsonld + +# config file +relay.yaml From a8c81f1d4078039a711191243cfe100ae0498e28 Mon Sep 17 00:00:00 2001 From: Louise de Beaufort Date: Tue, 20 Aug 2019 13:52:27 +0200 Subject: [PATCH 3/3] Add the whole directory in the workdir (Prevents a fatal error about not being a git repository) --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 922d95a..55db022 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,11 +2,10 @@ FROM python:3-alpine WORKDIR /workdir RUN apk add alpine-sdk autoconf automake libtool gcc -ADD relay /workdir/relay ADD requirements.txt /workdir/ RUN pip3 install -r requirements.txt -ADD relay.yaml /workdir/ +ADD . /workdir/ CMD ["python", "-m", "relay"] VOLUME ["/workdir/data"]