mirror of
https://github.com/GothenburgBitFactory/taskchampion-sync-server.git
synced 2025-06-26 10:54:29 +02:00
feat(docker): simplify docker compose for end users (#96)
* feat(docker): simplify docker compose for end users The previous docker-compose requires end user to manually handle permissions of taskchampion data dir. And this commit has directories automatically set up in docker-entrypoint.sh, just like what postgresql did in https://github.com/docker-library/postgres/blob/master/docker-entrypoint.sh * fix(docker): revert to anonymous data volume for compatibility * feat: use uid 1092 for taskchampion * fix(docker): revert mkdir This is embarrassing that subpaths are not automatically created. So we still need mkdir service in case of anonymous data volume. * fix(docker): typo
This commit is contained in:
parent
c47612b3a0
commit
65ad035d8d
4 changed files with 42 additions and 19 deletions
13
docker-entrypoint.sh
Executable file
13
docker-entrypoint.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
echo "starting entrypoint script..."
|
||||
if [ "$1" = "/bin/taskchampion-sync-server" ]; then
|
||||
echo "setting data directories"
|
||||
mkdir -p "/var/lib/taskchampion-sync-server/data"
|
||||
chown -R 1092:1092 "/var/lib/taskchampion-sync-server/data"
|
||||
chmod -R 700 "/var/lib/taskchampion-sync-server/data"
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
echo "switching to user 'taskchampion'"
|
||||
exec su-exec taskchampion "$@"
|
||||
fi
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue