finish oauth provider + docker service wait for MySQL

This commit is contained in:
xiaomlove
2025-05-01 14:18:30 +07:00
parent cc89e8aa59
commit af33e5cba7
26 changed files with 450 additions and 41 deletions

View File

@@ -53,7 +53,17 @@ fi
echo_info "USE_HTTPS: $USE_HTTPS"
# 组合子域名变量
export PHPMYADMIN_SERVER_NAME="phpmyadmin.${NP_DOMAIN}"
dot_count_tmp="${NP_DOMAIN//[^.]/}"
dot_count="${#dot_count_tmp}"
PHPMYADMIN="phpmyadmin"
if [ "$dot_count" -eq 1 ]; then
PHPMYADMIN="${PHPMYADMIN}."
else
PHPMYADMIN="${PHPMYADMIN}-"
fi
export PHPMYADMIN_SERVER_NAME="${PHPMYADMIN}${NP_DOMAIN}"
echo_info "PHPMYADMIN_SERVER_NAME: ${PHPMYADMIN_SERVER_NAME}"
# 生成配置
APP_CONF="/etc/nginx/conf.d/app.conf"

View File

@@ -36,6 +36,18 @@ VENDOR_DIR="${ROOT_PATH}/vendor"
chown -R www-data:www-data $ROOT_PATH
until nc -z mysql 3306; do
echo_info "Waiting for MySQL to be ready..."
sleep 2
done
echo_success "MySQL is ready."
until nc -z redis 6379; do
echo_info "Waiting for Redis to be ready..."
sleep 2
done
echo_success "Redis is ready."
if [ "$SERVICE_NAME" = "php" ]; then
if [ ! -f "$ENV_FILE" ]; then
echo_info ".env file: $ENV_FILE not exists, copy $SOURCE_DIR to $TARGET_DIR ..."