測試 docker 調整 20250528

This commit is contained in:
allen.yan 2025-05-28 17:01:44 +08:00
parent 038531815d
commit 13096f38e0
4 changed files with 16 additions and 14 deletions

View File

@ -1,10 +1,10 @@
APP_NAME=Laravel APP_NAME=Laravel
APP_ENV=local APP_ENV=production
APP_KEY= APP_KEY=
APP_DEBUG=true APP_DEBUG=false
APP_TIMEZONE=Asia/Taipei APP_TIMEZONE=Asia/Taipei
APP_URL=https://KTVCentral.test APP_URL=http://ctl1.superstar.dnsnet.cc
L5_SWAGGER_CONST_HOST=https://KTVCentral.test/ L5_SWAGGER_CONST_HOST=http://ctl1.superstar.dnsnet.cc
APP_LOCALE=zh-tw APP_LOCALE=zh-tw
APP_FALLBACK_LOCALE=zh-tw APP_FALLBACK_LOCALE=zh-tw
@ -25,7 +25,7 @@ LOG_LEVEL=debug
#DB_CONNECTION=sqlite #DB_CONNECTION=sqlite
DB_CONNECTION=mariadb DB_CONNECTION=mariadb
DB_HOST=127.0.0.1 DB_HOST=127.0.0.1
DB_PORT=3307 DB_PORT=3306
DB_DATABASE=Karaoke-Kingpin_Central DB_DATABASE=Karaoke-Kingpin_Central
DB_USERNAME=Karaoke-Kingpin DB_USERNAME=Karaoke-Kingpin
DB_PASSWORD=ESM7yTPMnavFmbBH DB_PASSWORD=ESM7yTPMnavFmbBH

View File

@ -22,6 +22,9 @@ class AppServiceProvider extends ServiceProvider
*/ */
public function boot(): void public function boot(): void
{ {
if (app()->environment('production')) {
config(['app.url' => request()->getSchemeAndHttpHost()]);
}
Room::observe(RoomObserver::class); Room::observe(RoomObserver::class);
} }
} }

View File

@ -1,10 +1,14 @@
server { server {
listen 80; listen 80 default_server;
server_name ktvcentral.localhost; server_name _; # 接收所有主機名稱的請求
root /var/www/html/public;
root /var/www/html/public;
index index.php index.html; index index.php index.html;
# 設定 log 檔案方便除錯(可選)
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / { location / {
try_files $uri $uri/ /index.php?$query_string; try_files $uri $uri/ /index.php?$query_string;
} }
@ -15,6 +19,7 @@ server {
include fastcgi_params; include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param APP_URL $http_host; # 將 host 傳給 Laravel 處理
} }
location ~ /\.ht { location ~ /\.ht {

View File

@ -20,9 +20,3 @@ command=cron -f
autostart=true autostart=true
autorestart=true autorestart=true
priority=3 priority=3
[program:sqlite-sync]
command=php /var/www/html/artisan transfer:sqlite sqlite/tempUser.sqlite --sync
autostart=true
autorestart=false
priority=4