Add UID/GID option and custom config base for docker

Closes #13
This commit is contained in:
Tulir Asokan 2018-11-04 23:05:39 +02:00
parent 2736a1f47f
commit 4bc78996c1
4 changed files with 92 additions and 26 deletions

21
docker/run.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh
function fixperms {
chown -R $UID:$GID /var/log /data /opt/maubot
}
cd /opt/maubot
if [ ! -f /data/config.yaml ]; then
cp docker/example-config.yaml /data/config.yaml
mkdir -p /var/log /data/plugins /data/trash /data/dbs
echo "Config file not found. Example config copied to /data/config.yaml"
echo "Please modify the config file to your liking and restart the container."
fixperms
exit
fi
mkdir -p /var/log/maubot /data/plugins /data/trash /data/dbs
#alembic -x config=/data/config.yaml upgrade head
fixperms
exec su-exec $UID:$GID python3 -m maubot -c /data/config.yaml -b docker/example-config.yaml