File tree 17 files changed +101
-52
lines changed
17 files changed +101
-52
lines changed Original file line number Diff line number Diff line change 1
- 2.10.2
1
+ 2.10.3
Original file line number Diff line number Diff line change 1
1
<p align =" center " >
2
2
<img src="https://nginxproxymanager.com/github.png">
3
3
<br><br>
4
- <img src="https://img.shields.io/badge/version-2.10.2 -green.svg?style=for-the-badge">
4
+ <img src="https://img.shields.io/badge/version-2.10.3 -green.svg?style=for-the-badge">
5
5
<a href="https://hub.docker.com/repository/docker/jc21/nginx-proxy-manager">
6
6
<img src="https://img.shields.io/docker/stars/jc21/nginx-proxy-manager.svg?style=for-the-badge">
7
7
</a>
Original file line number Diff line number Diff line change @@ -10,9 +10,13 @@ ARG BUILD_VERSION
10
10
ARG BUILD_COMMIT
11
11
ARG BUILD_DATE
12
12
13
+ # See: https://github.com/just-containers/s6-overlay/blob/master/README.md
13
14
ENV SUPPRESS_NO_CONFIG_WARNING=1 \
14
- S6_FIX_ATTRS_HIDDEN=1 \
15
15
S6_BEHAVIOUR_IF_STAGE2_FAILS=1 \
16
+ S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
17
+ S6_FIX_ATTRS_HIDDEN=1 \
18
+ S6_KILL_FINISH_MAXTIME=10000 \
19
+ S6_VERBOSITY=1 \
16
20
NODE_ENV=production \
17
21
NPM_BUILD_VERSION="${BUILD_VERSION}" \
18
22
NPM_BUILD_COMMIT="${BUILD_COMMIT}" \
Original file line number Diff line number Diff line change 1
1
FROM jc21/nginx-full:certbot-node
2
2
LABEL maintainer="Jamie Curnow <jc@jc21.com>"
3
3
4
- ENV S6_LOGGING=0 \
5
- SUPPRESS_NO_CONFIG_WARNING=1 \
6
- S6_FIX_ATTRS_HIDDEN=1
4
+ # See: https://github.com/just-containers/s6-overlay/blob/master/README.md
5
+ ENV SUPPRESS_NO_CONFIG_WARNING=1 \
6
+ S6_BEHAVIOUR_IF_STAGE2_FAILS=1 \
7
+ S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
8
+ S6_FIX_ATTRS_HIDDEN=1 \
9
+ S6_KILL_FINISH_MAXTIME=10000 \
10
+ S6_VERBOSITY=2
7
11
8
12
RUN echo "fs.file-max = 65535" > /etc/sysctl.conf \
9
13
&& apt-get update \
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ services:
35
35
DB_SQLITE_FILE : ' /data/mydb.sqlite'
36
36
PUID : 1000
37
37
PGID : 1000
38
+ DISABLE_IPV6 : ' true'
38
39
volumes :
39
40
- npm_data:/data
40
41
expose :
Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ export CYAN BLUE YELLOW RED RESET
12
12
PUID=${PUID:- 0}
13
13
PGID=${PGID:- 0}
14
14
15
+ NPMUSER=npm
16
+ NPMGROUP=npm
17
+ NPMHOME=/tmp/npmuserhome
18
+ export NPMUSER NPMGROUP NPMHOME
19
+
15
20
if [[ " $PUID " -ne ' 0' ]] && [ " $PGID " = ' 0' ]; then
16
21
# set group id to same as user id,
17
22
# the user probably forgot to specify the group id and
@@ -40,3 +45,10 @@ log_fatal () {
40
45
/run/s6/basedir/bin/halt
41
46
exit 1
42
47
}
48
+
49
+ # param $1: group_name
50
+ get_group_id () {
51
+ if [ " ${1:- } " != ' ' ]; then
52
+ getent group " $1 " | cut -d: -f3
53
+ fi
54
+ }
Original file line number Diff line number Diff line change 1
1
# run nginx in foreground
2
2
daemon off ;
3
3
pid /run/nginx/nginx.pid;
4
- user npmuser ;
4
+ user npm ;
5
5
6
6
# Set number of worker processes automatically based on number of CPU cores.
7
7
worker_processes auto;
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ cd /app || exit 1
10
10
log_info 'Starting backend ...'
11
11
12
12
if [ "${DEVELOPMENT:-}" = 'true' ]; then
13
- s6-setuidgid npmuser yarn install
14
- exec s6-setuidgid npmuser bash -c ' export HOME=/tmp/npmuserhome ;node --max_old_space_size=250 --abort_on_uncaught_exception node_modules/nodemon/bin/nodemon.js'
13
+ s6-setuidgid "$PUID:$PGID" yarn install
14
+ exec s6-setuidgid "$PUID:$PGID" bash -c " export HOME=$NPMHOME ;node --max_old_space_size=250 --abort_on_uncaught_exception node_modules/nodemon/bin/nodemon.js"
15
15
else
16
16
while :
17
17
do
18
- s6-setuidgid npmuser bash -c ' export HOME=/tmp/npmuserhome ;node --abort_on_uncaught_exception --max_old_space_size=250 index.js'
18
+ s6-setuidgid "$PUID:$PGID" bash -c " export HOME=$NPMHOME ;node --abort_on_uncaught_exception --max_old_space_size=250 index.js"
19
19
sleep 1
20
20
done
21
21
fi
Original file line number Diff line number Diff line change 8
8
if [ "$DEVELOPMENT" = 'true' ]; then
9
9
. /bin/common.sh
10
10
cd /app/frontend || exit 1
11
- HOME=/tmp/npmuserhome
11
+ HOME=$NPMHOME
12
12
export HOME
13
13
mkdir -p /app/frontend/dist
14
14
chown -R "$PUID:$PGID" /app/frontend/dist
15
15
16
16
log_info 'Starting frontend ...'
17
- s6-setuidgid npmuser yarn install
18
- exec s6-setuidgid npmuser yarn watch
17
+ s6-setuidgid "$PUID:$PGID" yarn install
18
+ exec s6-setuidgid "$PUID:$PGID" yarn watch
19
19
else
20
20
exit 0
21
21
fi
Original file line number Diff line number Diff line change 6
6
. /bin/common.sh
7
7
8
8
log_info 'Starting nginx ...'
9
- exec s6-setuidgid npmuser nginx
9
+ exec s6-setuidgid "$PUID:$PGID" nginx
Original file line number Diff line number Diff line change @@ -9,7 +9,11 @@ if [ "$(id -u)" != "0" ]; then
9
9
log_fatal " This docker container must be run as root, do not specify a user.\nYou can specify PUID and PGID env vars to run processes as that user and group after initialization."
10
10
fi
11
11
12
- . /etc/s6-overlay/s6-rc.d/prepare/10-npmuser.sh
12
+ if [ " $DEBUG " = " true" ]; then
13
+ set -x
14
+ fi
15
+
16
+ . /etc/s6-overlay/s6-rc.d/prepare/10-usergroup.sh
13
17
. /etc/s6-overlay/s6-rc.d/prepare/20-paths.sh
14
18
. /etc/s6-overlay/s6-rc.d/prepare/30-ownership.sh
15
19
. /etc/s6-overlay/s6-rc.d/prepare/40-dynamic.sh
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ #! /command/with-contenv bash
2
+ # shellcheck shell=bash
3
+
4
+ set -e
5
+
6
+ log_info " Configuring $NPMUSER user ..."
7
+
8
+ if id -u " $NPMUSER " 2> /dev/null; then
9
+ # user already exists
10
+ usermod -u " $PUID " " $NPMUSER "
11
+ else
12
+ # Add user
13
+ useradd -o -u " $PUID " -U -d " $NPMHOME " -s /bin/false " $NPMUSER "
14
+ fi
15
+
16
+ log_info " Configuring $NPMGROUP group ..."
17
+ if [ " $( get_group_id " $NPMGROUP " ) " = ' ' ]; then
18
+ # Add group. This will not set the id properly if it's already taken
19
+ groupadd -f -g " $PGID " " $NPMGROUP "
20
+ else
21
+ groupmod -o -g " $PGID " " $NPMGROUP "
22
+ fi
23
+
24
+ # Set the group ID and check it
25
+ groupmod -o -g " $PGID " " $NPMGROUP "
26
+ if [ " $( get_group_id " $NPMGROUP " ) " != " $PGID " ]; then
27
+ echo " ERROR: Unable to set group id properly"
28
+ exit 1
29
+ fi
30
+
31
+ # Set the group against the user and check it
32
+ usermod -G " $PGID " " $NPMGROUP "
33
+ if [ " $( id -g " $NPMUSER " ) " != " $PGID " ] ; then
34
+ echo " ERROR: Unable to set group against the user properly"
35
+ exit 1
36
+ fi
37
+
38
+ # Home for user
39
+ mkdir -p " $NPMHOME "
40
+ chown -R " $PUID :$PGID " " $NPMHOME "
Original file line number Diff line number Diff line change @@ -8,17 +8,17 @@ log_info 'Setting ownership ...'
8
8
# root
9
9
chown root /tmp/nginx
10
10
11
- # npmuser
12
- chown -R " $PUID :$PGID " /data \
13
- /etc/letsencrypt \
14
- /run/nginx \
15
- /tmp/nginx \
16
- /var/cache/nginx \
17
- /var/lib/logrotate \
18
- /var/lib/nginx \
19
- /var/log/nginx
11
+ # npm user and group
12
+ chown -R " $PUID :$PGID " /data
13
+ chown -R " $PUID : $PGID " /etc/letsencrypt
14
+ chown -R " $PUID : $PGID " /run/nginx
15
+ chown -R " $PUID : $PGID " /tmp/nginx
16
+ chown -R " $PUID : $PGID " /var/cache/nginx
17
+ chown -R " $PUID : $PGID " /var/lib/logrotate
18
+ chown -R " $PUID : $PGID " /var/lib/nginx
19
+ chown -R " $PUID : $PGID " /var/log/nginx
20
20
21
21
# Don't chown entire /etc/nginx folder as this causes crashes on some systems
22
- chown -R " $PUID :$PGID " /etc/nginx/nginx \
23
- /etc/nginx/nginx.conf \
24
- /etc/nginx/conf.d
22
+ chown -R " $PUID :$PGID " /etc/nginx/nginx
23
+ chown -R " $PUID : $PGID " /etc/nginx/nginx.conf
24
+ chown -R " $PUID : $PGID " /etc/nginx/conf.d
Original file line number Diff line number Diff line change 1
- #! /bin/bash
1
+ #! /command/with-contenv bash
2
+ # shellcheck shell=bash
2
3
3
4
# This command reads the `DISABLE_IPV6` env var and will either enable
4
5
# or disable ipv6 in all nginx configs based on this setting.
5
6
7
+ set -e
8
+
6
9
log_info ' IPv6 ...'
7
10
8
11
# Lowercase
@@ -28,7 +31,7 @@ process_folder () {
28
31
sed -E -i " $SED_REGEX " " $FILE "
29
32
done
30
33
31
- # ensure the files are still owned by the npmuser
34
+ # ensure the files are still owned by the npm user
32
35
chown -R " $PUID :$PGID " " $1 "
33
36
}
34
37
Original file line number Diff line number Diff line change 2
2
# shellcheck shell=bash
3
3
4
4
set -e
5
+ set +x
5
6
6
7
echo "
7
8
-------------------------------------
11
12
| |\ | __/| | | |
12
13
|_| \_|_| |_| |_|
13
14
-------------------------------------
14
- User ID: $PUID
15
- Group ID: $PGID
15
+ User: $NPMUSER PUID: $PUID ID:$( id -u " $NPMUSER " ) GROUP: $( id -g " $NPMUSER " )
16
+ Group: $NPMGROUP PGID: $PGID ID:$( get_group_id " $NPMGROUP " )
16
17
-------------------------------------
17
18
"
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ BLUE='\E[1;34m'
8
8
GREEN=' \E[1;32m'
9
9
RESET=' \E[0m'
10
10
11
- S6_OVERLAY_VERSION=3.1.4.1
11
+ S6_OVERLAY_VERSION=3.1.5.0
12
12
TARGETPLATFORM=${1: unspecified}
13
13
14
14
# Determine the correct binary file for the architecture given
You can’t perform that action at this time.
0 commit comments