-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from DDS-Derek/master
Add PUID, PGID, Umask settings to Docker image
- Loading branch information
Showing
3 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
FROM node:lts-alpine | ||
|
||
LABEL MAINTAINER likun7981 | ||
RUN npm i -g hlink | ||
|
||
ENV DOCKER=true \ | ||
PS1="\u@\h:\w \$ " \ | ||
PUID=1000 \ | ||
PGID=1000 \ | ||
UMASK=022 | ||
|
||
RUN apk add --no-cache \ | ||
bash \ | ||
su-exec \ | ||
&& \ | ||
npm i -g hlink | ||
|
||
COPY --chmod=755 entrypoint.sh /entrypoint.sh | ||
|
||
ENTRYPOINT [ "/entrypoint.sh" ] | ||
|
||
EXPOSE 9090 | ||
ENV DOCKER true | ||
ENTRYPOINT hlink start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
if [[ -n "${HLINK_HOME}" ]]; then | ||
if [[ "$(stat -c '%u' ${HLINK_HOME})" != "${PUID}" ]] || [[ "$(stat -c '%g' ${HLINK_HOME})" != "${PGID}" ]]; then | ||
chown ${PUID}:${PGID} \ | ||
${HLINK_HOME} | ||
fi | ||
fi | ||
|
||
umask ${UMASK} | ||
|
||
su-exec ${PUID}:${PGID} hlink start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cafbb2b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
hlink – ./
hlink.vercel.app
hlink.likun.me
hlink-likun7981.vercel.app
hlink-git-master-likun7981.vercel.app
hlink.likun7981.cn