feat: use uid 1092 for taskchampion

This commit is contained in:
adamanteye 2025-03-02 01:07:10 +08:00
parent b88cdd1c69
commit 2bb61d0db8
No known key found for this signature in database
GPG key ID: FC012E34C8FFF4AB
2 changed files with 3 additions and 3 deletions

View file

@ -15,9 +15,9 @@ RUN apk -U add libc-dev && \
FROM docker.io/alpine:${ALPINE_VERSION}
COPY --from=builder /data/target/release/taskchampion-sync-server /bin
RUN apk add --no-cache su-exec && \
adduser -u 100 -S -D -H -h /var/lib/taskchampion-sync-server -s /sbin/nologin -G users \
adduser -u 1092 -S -D -H -h /var/lib/taskchampion-sync-server -s /sbin/nologin -G users \
-g taskchampion taskchampion && \
install -d -m1755 -o100 -g100 "/var/lib/taskchampion-sync-server"
install -d -m1755 -o1092 -g1092 "/var/lib/taskchampion-sync-server"
EXPOSE 8080
VOLUME /var/lib/task-champion-sync-server/data
COPY docker-entrypoint.sh /bin

View file

@ -4,7 +4,7 @@ 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 100:100 "/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'"