Skip to content

Commit

Permalink
feat: add PUID, PGID, Umask settings to docker image (close #2525
Browse files Browse the repository at this point in the history
… pr #2818)

Co-authored-by: DDSRem <[email protected]>
  • Loading branch information
DDSDerek and DDSRem authored Dec 28, 2022
1 parent 83fe17c commit ed6c819
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ LABEL MAINTAINER="[email protected]"
VOLUME /opt/alist/data/
WORKDIR /opt/alist/
COPY --from=builder /app/bin/alist ./
RUN apk add ca-certificates
COPY entrypoint.sh /entrypoint.sh

This comment has been minimized.

Copy link
@devnakx

devnakx Dec 29, 2022

没有给执行权限,部署后会报Permission Denied
后面再加行RUN chmod +x /entrypoint.sh

RUN apk add ca-certificates bash su-exec
ENV PUID=1000 PGID=1000 UMASK=022
EXPOSE 5244
CMD [ "./alist", "server", "--no-prefix" ]
ENTRYPOINT [ "/entrypoint.sh" ]
7 changes: 7 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

chown -R ${PUID}:${PGID} /opt/alist/

umask ${UMASK}

exec su-exec ${PUID}:${PGID} ./alist server --no-prefix

0 comments on commit ed6c819

Please sign in to comment.