Compare commits

...

3 commits

Author SHA1 Message Date
Kevin Norman
dda8aa4b97
Merge 4367476ace into d7ffa33950 2024-10-18 00:25:34 +00:00
Kevin Norman
4367476ace
Merge branch 'master' into make_puid_pgid_do_stuff 2024-02-20 22:35:18 -05:00
kn100
d0c9d65586 respect users specified pgid/puid 2024-01-23 10:11:07 -05:00
2 changed files with 14 additions and 2 deletions

View file

@ -27,7 +27,7 @@ RUN mkdir ./data
# ⭐ Main Image # ⭐ Main Image
############################################ ############################################
FROM $BASE_IMAGE AS release FROM $BASE_IMAGE AS release
USER node COPY ./docker/scripts/init.sh /usr/bin/init.sh
WORKDIR /app WORKDIR /app
LABEL org.opencontainers.image.source="https://github.com/louislam/uptime-kuma" LABEL org.opencontainers.image.source="https://github.com/louislam/uptime-kuma"
@ -40,7 +40,7 @@ COPY --chown=node:node --from=build /app /app
EXPOSE 3001 EXPOSE 3001
HEALTHCHECK --interval=60s --timeout=30s --start-period=180s --retries=5 CMD extra/healthcheck HEALTHCHECK --interval=60s --timeout=30s --start-period=180s --retries=5 CMD extra/healthcheck
ENTRYPOINT ["/usr/bin/dumb-init", "--"] ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["node", "server/server.js"] CMD ["/usr/bin/init.sh"]
############################################ ############################################
# Rootless Image # Rootless Image

12
docker/scripts/init.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
PUID=${PUID:-1000}
PGID=${PGID:-1000}
groupmod -o -g "$PGID" node
usermod -o -u "$PUID" node
echo "node has uid: $(id -u node) and gid: $(id -g node)"
echo "dropping to node user"
exec sudo -u node node server/server.js