Rebuild docker-entrypoint scripts

This commit is contained in:
cytopia
2018-02-27 09:32:49 +01:00
parent 7d41e38374
commit f5491d91fc
27 changed files with 530 additions and 610 deletions

View File

@@ -1,17 +1,21 @@
#!/bin/sh
#
# Available global variables:
# + MY_USER
# + MY_GROUP
# + DEBUG_LEVEL
#!/usr/bin/env bash
###
### Settings
###
set -e
set -u
set -p pipefail
###
### Globals
###
# The following global variables are available by our Dockerfile itself:
# MY_USER
# MY_GROUP
# MY_UID
# MY_GID
# Path to scripts to source
CONFIG_DIR="/docker-entrypoint.d"
@@ -25,27 +29,27 @@ for f in ${init}; do
done
###
### Set Debug level
###
DEBUG_LEVEL="$( get_debug_level "DEBUG_ENTRYPOINT" "0" )"
log "info" "Debug level: ${DEBUG_LEVEL}"
#############################################################
## Entry Point
#############################################################
###
### Set Debug level
###
DEBUG_LEVEL="$( env_get "DEBUG_ENTRYPOINT" "0" )"
log "info" "Debug level: ${DEBUG_LEVEL}" "${DEBUG_LEVEL}"
###
### Change uid/gid
###
set_uid "NEW_UID"
set_gid "NEW_GID"
set_uid "NEW_UID" "${MY_USER}" "/home/${MY_USER}" "${DEBUG_LEVEL}"
set_gid "NEW_GID" "${MY_GROUP}" "/home/${MY_USER}" "${DEBUG_LEVEL}"
###
### Startup
###
log "info" "Starting $( php-fpm -v 2>&1 | head -1 )"
log "info" "Starting $( php-fpm -v 2>&1 | head -1 )" "${DEBUG_LEVEL}"
exec /usr/local/sbin/php-fpm