commit 578f9ca27603b34e0f111d2fe0002ba2e10f8761
parent ac5b030ec2ed7b5029476b3b727563dc44fe2aee
Author: cpnfeeny <49805214+cpnfeeny@users.noreply.github.com>
Date: Thu, 15 Apr 2021 17:31:33 +0200
updating docker tools (#56)
updated the docker run command, changing the -d options to -v.
added a start.sh file and edited the Dockerfile.
Diffstat:
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
@@ -1,5 +1,8 @@
FROM alpine:latest
RUN apk add cargo && wget https://github.com/mbrubeck/agate/archive/refs/tags/v3.0.2.tar.gz && tar xzf v3.0.2.tar.gz && mv /agate-3.0.2 /agate && cd agate && cargo build --release
-CMD /agate --content /gmi/ \
- --hostname $GEMINI_HOST \
- --lang $GEMINI_LANG
+RUN cp /agate/target/release/agate /usr/bin/agate
+WORKDIR /app
+COPY . /app
+ADD . .
+ENTRYPOINT ["/bin/sh", "start.sh"]
+
diff --git a/tools/docker/README.md b/tools/docker/README.md
@@ -45,7 +45,7 @@ This process will take a few minutes because all the rust modules have to be com
## start the docker container
```
-docker run -t -d --name agate -p 1965:1965 -d /var/www/gmi/:/gmi/ -d /var/www/gmi/.certificates/:/.certificates/ -e GEMINI_HOST=example.org -e GEMINI_LANG=en-US agate:latest
+docker run -t -d -p 1965:1965 -v /var/www/gmi/:/gmi/ -v /var/www/gmi/.certificates/:/.certificates/ -e HOSTNAME=example.org -e LANG=en-US agate:latest
```
You have to replace `/var/www/gmi/` with the folder where you'd like to have gemtext files and `/var/www/gmi/.certificates/` with the folder where you'd like to have your certificates stored. You also have to have to replace `example.org` with your domain name and if plan to speak in a different language than english in your gemini space than you should replace `en-US` with your countries language code (for example de-DE or fr-CA).
diff --git a/tools/docker/start.sh b/tools/docker/start.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+exec agate --content /gmi/ \
+ --hostname ${HOSTNAME} \
+ --lang ${LANG}
+