diff --git a/Dockerfile b/Dockerfile index b824933..0c4588f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,8 @@ RUN pacman -Sy --noconfirm archlinux-keyring && \ python-mutagen COPY --from=builder /app/target/release/hoard /hoard +COPY ./entrypoint.sh /entrypoint.sh WORKDIR / -CMD ["/hoard"] +CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..835dde2 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +echo "Creating User ${UID:-1000}" +usermod -u "${UID:-1000}" hoard || exit 1 + +chown -R hoard /downloads +mkdir /.cache && chown -R hoard /.cache +chown -R hoard /download.db + +su hoard -c /hoard