fix: 更新Docker构建脚本
This commit is contained in:
30
pkg/docker/linux/usr/local/etc/omc/script/entrypoint.sh
Normal file
30
pkg/docker/linux/usr/local/etc/omc/script/entrypoint.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
# set -o xtrace # Uncomment this line for debugging purposes
|
||||
|
||||
# Load OMC environment variables
|
||||
. /usr/local/etc/omc/script/omc-env.sh
|
||||
|
||||
# Initialize OMC DB
|
||||
if [ ! -f /usr/local/etc/omc/omc.conf ]; then
|
||||
bash /usr/local/etc/omc/script/setup.sh -i -m $M_PARAM -c $C_PARAM
|
||||
fi
|
||||
|
||||
# We add the copy from default config in the entrypoint to not break users
|
||||
# case someone mounts a configuration file in /usr/local/etc/omc/default)
|
||||
cp -nr "$BASE_DIR"/default/. "$BASE_DIR"
|
||||
|
||||
if [[ "$*" = *"/usr/local/etc/omc/script/run.sh"* || "$*" = *"run.sh"* ]]; then
|
||||
# Ensure OMC is initialized
|
||||
omcd version
|
||||
# Start Nginx server
|
||||
nginx -g "daemon off;"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user