fix #11: added DISABLE_WEBROOT_CHOWN
This commit is contained in:
@@ -35,6 +35,7 @@ services:
|
|||||||
FPM_START_SERVERS: 1 # default: 1
|
FPM_START_SERVERS: 1 # default: 1
|
||||||
FPM_MIN_SPARE_SERVERS: 1 # default: 1
|
FPM_MIN_SPARE_SERVERS: 1 # default: 1
|
||||||
FPM_MAX_SPARE_SERVERS: 3 # default: 3
|
FPM_MAX_SPARE_SERVERS: 3 # default: 3
|
||||||
|
DISABLE_WEBROOT_CHOWN: 1 # default: 0
|
||||||
```
|
```
|
||||||
|
|
||||||
The `/data/www` and `/data/logs` directories and their contents will be chowned to `$PUID:$PGID` and chmodded to `0755` for directories and `0644` for files at container start.
|
The `/data/www` and `/data/logs` directories and their contents will be chowned to `$PUID:$PGID` and chmodded to `0755` for directories and `0644` for files at container start.
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ FPM_START_SERVERS=${FPM_START_SERVERS:-1}
|
|||||||
FPM_MIN_SPARE_SERVERS=${FPM_MIN_SPARE_SERVERS:-1}
|
FPM_MIN_SPARE_SERVERS=${FPM_MIN_SPARE_SERVERS:-1}
|
||||||
FPM_MAX_SPARE_SERVERS=${FPM_MAX_SPARE_SERVERS:-3}
|
FPM_MAX_SPARE_SERVERS=${FPM_MAX_SPARE_SERVERS:-3}
|
||||||
|
|
||||||
|
DISABLE_WEBROOT_CHOWN=${DISABLE_WEBROOT_CHOWN:-0}
|
||||||
|
|
||||||
export USERNAME
|
export USERNAME
|
||||||
export GROUPNAME
|
export GROUPNAME
|
||||||
export PATH_BASE
|
export PATH_BASE
|
||||||
@@ -46,6 +48,8 @@ export FPM_START_SERVERS
|
|||||||
export FPM_MIN_SPARE_SERVERS
|
export FPM_MIN_SPARE_SERVERS
|
||||||
export FPM_MAX_SPARE_SERVERS
|
export FPM_MAX_SPARE_SERVERS
|
||||||
|
|
||||||
|
export DISABLE_WEBROOT_CHOWN
|
||||||
|
|
||||||
# run all scripts in order
|
# run all scripts in order
|
||||||
run-parts /app/entrypoint.sh.d
|
run-parts /app/entrypoint.sh.d
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "# chowning ${PATH_WEBROOT} to ${PUID}:${GROUPNAME}..."
|
echo "# Started background chowning of ${PATH_WEBROOT} to ${USERNAME}:${GROUPNAME} (${PUID}:${PGID})..."
|
||||||
|
|
||||||
chown "${PUID}:${GROUPNAME}" "${PATH_WEBROOT}" -R
|
if [ ${DISABLE_WEBROOT_CHOWN} -eq 1 ] ; then
|
||||||
|
echo chowning skipped because of DISABLE_WEBROOT_CHOWN
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
chown "${USERNAME}:${GROUPNAME}" "${PATH_WEBROOT}" -R
|
||||||
find "${PATH_WEBROOT}" -type d -exec chmod 0755 {} \; &
|
find "${PATH_WEBROOT}" -type d -exec chmod 0755 {} \; &
|
||||||
find "${PATH_WEBROOT}" -type f -exec chmod 0644 {} \; &
|
find "${PATH_WEBROOT}" -type f -exec chmod 0644 {} \; &
|
||||||
|
|||||||
Reference in New Issue
Block a user