Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ RUN chmod 644 /etc/logrotate.d/nginx-proxy-manager
RUN pip uninstall --yes setuptools \
&& pip install "setuptools==58.0.0"

RUN groupmod -g 1000 users \
&& useradd -u 911 -U -d /data -s /bin/false abc \
&& usermod -G users abc

VOLUME [ "/data", "/etc/letsencrypt" ]
ENTRYPOINT [ "/init" ]

Expand Down
7 changes: 0 additions & 7 deletions docker/rootfs/etc/cont-init.d/01_perms.sh

This file was deleted.

25 changes: 25 additions & 0 deletions docker/rootfs/etc/cont-init.d/02_perms.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/with-contenv bash
set -e

PUID=${PUID:-911}
PGID=${PGID:-911}

groupmod -o -g "$PGID" abc
usermod -o -u "$PUID" abc

echo '
-------------------------------------
GID/UID
-------------------------------------'
echo "
User uid: $(id -u abc)
User gid: $(id -g abc)
-------------------------------------
"

mkdir -p /data/logs
echo "Changing ownership of /data to abc:abc"
chown -R abc:abc /data

echo "Changing ownership of /etc/letsencrypt to abc:abc"
chown -R abc:abc /etc/letsencrypt
6 changes: 4 additions & 2 deletions docker/rootfs/etc/logrotate.d/nginx-proxy-manager
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/data/logs/*_access.log /data/logs/*/access.log {
create 0644 root root
su root root
create 0644 abc abc
weekly
rotate 4
missingok
Expand All @@ -12,7 +13,8 @@
}

/data/logs/*_error.log /data/logs/*/error.log {
create 0644 root root
su root root
create 0644 abc abc
weekly
rotate 10
missingok
Expand Down
8 changes: 8 additions & 0 deletions docs/setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ services:
# Uncomment this if IPv6 is not enabled on your host
# DISABLE_IPV6: 'true'

# Uncomment this if you want to use custom UID/GID
# PUID: 1000
# PGID: 1000

volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
Expand Down Expand Up @@ -71,6 +75,10 @@ services:
DB_MYSQL_NAME: "npm"
# Uncomment this if IPv6 is not enabled on your host
# DISABLE_IPV6: 'true'

# Uncomment this if you want to use custom UID/GID
# PUID: 1000
# PGID: 1000
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
Expand Down