diff --git a/Dockerfile b/Dockerfile index a59b293c..7743a344 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,13 @@ FROM alpine:3.14.2 LABEL maintainer="monkeyWie" WORKDIR /app COPY --from=go /app/dist/gopeed ./ +COPY entrypoint.sh ./entrypoint.sh +RUN apk update && \ + apk upgrade --no-cache && \ + apk add --no-cache bash su-exec; \ + chmod +x ./entrypoint.sh && \ + rm -rf /var/cache/apk/* VOLUME ["/app/storage"] +ENV PUID=0 PGID=0 UMASK=022 EXPOSE 9999 -ENTRYPOINT ["./gopeed"] +ENTRYPOINT ["./entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 00000000..f86debdd --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +chown -R ${PUID}:${PGID} /app/Download + +umask ${UMASK} + +exec su-exec ${PUID}:${PGID} ./gopeed "$@" \ No newline at end of file