KTVSinglePublisher V.0.0.4

加入 redis
This commit is contained in:
allen.yan 2025-06-20 09:58:03 +08:00
parent abd0ebb455
commit 956426e187
2 changed files with 12 additions and 1 deletions

View File

@ -15,6 +15,11 @@ services:
BRANCH: ${REPO_BRANCH:-main} BRANCH: ${REPO_BRANCH:-main}
DB_HOST: mariadb DB_HOST: mariadb
DB_PORT: 3306 DB_PORT: 3306
REDIS_HOST: redis
REDIS_PORT: 6379
SESSION_DRIVER: redis
QUEUE_CONNECTION: redis
CACHE_STORE: redis
APP_NAME: ${APP_NAME} APP_NAME: ${APP_NAME}
APP_URL: ${APP_URL} APP_URL: ${APP_URL}
NGINX_HOST: ${APP_DOMAIN} NGINX_HOST: ${APP_DOMAIN}

View File

@ -9,12 +9,13 @@ TARGET_DIR=/var/www/html
if [ -z "$(ls -A "$TARGET_DIR")" ]; then if [ -z "$(ls -A "$TARGET_DIR")" ]; then
echo "[entrypoint] Cloning $BRANCH from $REPO_URL ..." echo "[entrypoint] Cloning $BRANCH from $REPO_URL ..."
git clone --branch "$BRANCH" "$REPO_URL" "$TARGET_DIR" git clone --branch "$BRANCH" "$REPO_URL" "$TARGET_DIR"
cd "$TARGET_DIR"
else else
echo "[entrypoint] Repository already present, pulling." echo "[entrypoint] Repository already present, pulling."
cd "$TARGET_DIR"
git pull origin "$BRANCH" git pull origin "$BRANCH"
fi fi
cd "$TARGET_DIR"
# 2) Laravel 基礎安裝 # 2) Laravel 基礎安裝
[ -d vendor ] || composer install --no-interaction --prefer-dist [ -d vendor ] || composer install --no-interaction --prefer-dist
@ -25,6 +26,11 @@ update_env APP_NAME "$APP_NAME"
update_env APP_URL "${APP_URL%/}" update_env APP_URL "${APP_URL%/}"
update_env DB_HOST "$DB_HOST" update_env DB_HOST "$DB_HOST"
update_env DB_PORT "$DB_PORT" update_env DB_PORT "$DB_PORT"
update_env REDIS_HOST "$DB_PORT"
update_env REDIS_PORT "$DB_PORT"
update_env SESSION_DRIVER "$SESSION_DRIVER"
update_env QUEUE_CONNECTION "$QUEUE_CONNECTION"
update_env CACHE_STORE "$CACHE_STORE"
php artisan key:generate --force php artisan key:generate --force
php artisan migrate --force php artisan migrate --force