diff --git a/Dockerfile b/Dockerfile index b41b005f..dd709a63 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,8 @@ LABEL MAINTAINER="i@nn.ci" VOLUME /opt/alist/data/ WORKDIR /opt/alist/ COPY --from=builder /app/bin/alist ./ -RUN apk add ca-certificates +COPY entrypoint.sh /entrypoint.sh +RUN apk add ca-certificates bash su-exec +ENV PUID=1000 PGID=1000 UMASK=022 EXPOSE 5244 -CMD [ "./alist", "server", "--no-prefix" ] \ No newline at end of file +ENTRYPOINT [ "/entrypoint.sh" ] \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 00000000..05bbf8d3 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +chown -R ${PUID}:${PGID} /opt/alist/ + +umask ${UMASK} + +exec su-exec ${PUID}:${PGID} ./alist server --no-prefix \ No newline at end of file