移除 docker 資料
調整設定 寫法 20250602
This commit is contained in:
parent
eaf2022dc5
commit
86d8d8ccd4
@ -4,7 +4,6 @@ APP_KEY=
|
|||||||
APP_DEBUG=false
|
APP_DEBUG=false
|
||||||
APP_TIMEZONE=Asia/Taipei
|
APP_TIMEZONE=Asia/Taipei
|
||||||
APP_URL=http://ctl1.superstar.dnsnet.cc
|
APP_URL=http://ctl1.superstar.dnsnet.cc
|
||||||
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
|
||||||
@ -26,8 +25,8 @@ LOG_LEVEL=debug
|
|||||||
DB_CONNECTION=mariadb
|
DB_CONNECTION=mariadb
|
||||||
DB_HOST=127.0.0.1
|
DB_HOST=127.0.0.1
|
||||||
DB_PORT=3306
|
DB_PORT=3306
|
||||||
DB_DATABASE=Karaoke-Kingpin_Central
|
DB_DATABASE=KaraokeKingpin
|
||||||
DB_USERNAME=Karaoke-Kingpin
|
DB_USERNAME=KaraokeKingpin
|
||||||
DB_PASSWORD=ESM7yTPMnavFmbBH
|
DB_PASSWORD=ESM7yTPMnavFmbBH
|
||||||
|
|
||||||
SESSION_DRIVER=database
|
SESSION_DRIVER=database
|
||||||
|
54
Dockerfile
54
Dockerfile
@ -1,54 +0,0 @@
|
|||||||
# Dockerfile
|
|
||||||
# 基礎 PHP + Node + Composer
|
|
||||||
FROM php:8.3-fpm
|
|
||||||
|
|
||||||
|
|
||||||
# 安裝系統套件與 PHP 擴充
|
|
||||||
RUN apt-get update && apt-get install -y \
|
|
||||||
git \
|
|
||||||
unzip \
|
|
||||||
zip \
|
|
||||||
curl \
|
|
||||||
libpng-dev \
|
|
||||||
libjpeg62-turbo-dev \
|
|
||||||
libfreetype6-dev \
|
|
||||||
libonig-dev \
|
|
||||||
libxml2-dev \
|
|
||||||
libzip-dev \
|
|
||||||
libpq-dev \
|
|
||||||
libicu-dev \
|
|
||||||
libxslt-dev \
|
|
||||||
libsqlite3-dev \
|
|
||||||
sqlite3 \
|
|
||||||
cron \
|
|
||||||
supervisor \
|
|
||||||
nodejs \
|
|
||||||
npm \
|
|
||||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
||||||
&& docker-php-ext-install \
|
|
||||||
gd \
|
|
||||||
pdo_mysql \
|
|
||||||
zip \
|
|
||||||
bcmath \
|
|
||||||
intl \
|
|
||||||
xsl \
|
|
||||||
pcntl \
|
|
||||||
sockets
|
|
||||||
|
|
||||||
# 安裝 Composer
|
|
||||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
||||||
|
|
||||||
# 安裝 Node.js 與 npm
|
|
||||||
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
|
|
||||||
&& apt-get install -y nodejs
|
|
||||||
|
|
||||||
# 建立 Laravel 專案目錄
|
|
||||||
WORKDIR /var/www/html
|
|
||||||
|
|
||||||
# 複製 supervisord 設定與啟動腳本
|
|
||||||
COPY ./docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
||||||
COPY ./docker/entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
||||||
RUN chmod +x /usr/local/bin/entrypoint.sh
|
|
||||||
|
|
||||||
# 啟動腳本
|
|
||||||
CMD ["/usr/local/bin/entrypoint.sh"]
|
|
@ -312,7 +312,7 @@ return [
|
|||||||
* Constants which can be used in annotations
|
* Constants which can be used in annotations
|
||||||
*/
|
*/
|
||||||
'constants' => [
|
'constants' => [
|
||||||
'L5_SWAGGER_CONST_HOST' => env('L5_SWAGGER_CONST_HOST', 'http://my-default-host.com'),
|
'L5_SWAGGER_CONST_HOST' => env('L5_SWAGGER_CONST_HOST', env('APP_URL', 'http://localhost')),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
|
|
||||||
services:
|
|
||||||
app:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
container_name: KTVCentral
|
|
||||||
volumes:
|
|
||||||
- ./:/var/www/html
|
|
||||||
depends_on:
|
|
||||||
- mariadb
|
|
||||||
environment:
|
|
||||||
DB_CONNECTION: mariadb
|
|
||||||
DB_HOST: mariadb
|
|
||||||
DB_PORT: 3306
|
|
||||||
DB_DATABASE: Karaoke-Kingpin
|
|
||||||
DB_USERNAME: Karaoke-Kingpin
|
|
||||||
DB_PASSWORD: ESM7yTPMnavFmbBH
|
|
||||||
|
|
||||||
mariadb:
|
|
||||||
image: mariadb:10.6
|
|
||||||
container_name: KTVCentral_db
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
MYSQL_ROOT_PASSWORD: root
|
|
||||||
MYSQL_DATABASE: Karaoke-Kingpin
|
|
||||||
MYSQL_USER: Karaoke-Kingpin
|
|
||||||
MYSQL_PASSWORD: ESM7yTPMnavFmbBH
|
|
||||||
volumes:
|
|
||||||
- dbdata:/var/lib/mysql
|
|
||||||
ports:
|
|
||||||
- "3306:3306"
|
|
||||||
|
|
||||||
nginx:
|
|
||||||
image: nginx:stable-alpine
|
|
||||||
container_name: KTVCentral_nginx
|
|
||||||
ports:
|
|
||||||
- "8080:80"
|
|
||||||
volumes:
|
|
||||||
- ./:/var/www/html
|
|
||||||
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
|
|
||||||
depends_on:
|
|
||||||
- app
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
dbdata:
|
|
@ -1,16 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# 啟動前置作業
|
|
||||||
cd /var/www/html
|
|
||||||
|
|
||||||
composer install
|
|
||||||
cp .env.example .env
|
|
||||||
php artisan key:generate
|
|
||||||
npm install && npm run build
|
|
||||||
php artisan migrate --force
|
|
||||||
|
|
||||||
# 加入 Laravel 排程至 cron
|
|
||||||
echo "* * * * * cd /var/www/html && php artisan schedule:run >> /dev/null 2>&1" | crontab -
|
|
||||||
|
|
||||||
# 啟動 Supervisor
|
|
||||||
exec supervisord -n
|
|
@ -1,28 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80 default_server;
|
|
||||||
server_name _; # 接收所有主機名稱的請求
|
|
||||||
|
|
||||||
root /var/www/html/public;
|
|
||||||
index index.php index.html;
|
|
||||||
|
|
||||||
# 設定 log 檔案方便除錯(可選)
|
|
||||||
access_log /var/log/nginx/access.log;
|
|
||||||
error_log /var/log/nginx/error.log;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
try_files $uri $uri/ /index.php?$query_string;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ \.php$ {
|
|
||||||
fastcgi_pass app:9000;
|
|
||||||
fastcgi_index index.php;
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
||||||
fastcgi_param APP_URL $http_host; # 將 host 傳給 Laravel 處理
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ /\.ht {
|
|
||||||
deny all;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
[supervisord]
|
|
||||||
nodaemon=true
|
|
||||||
|
|
||||||
[program:php-fpm]
|
|
||||||
command=docker-php-entrypoint php-fpm
|
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
priority=1
|
|
||||||
|
|
||||||
[program:queue-worker]
|
|
||||||
command=php /var/www/html/artisan queue:work --daemon --timeout=3600 --tries=1 --queue=default
|
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
priority=2
|
|
||||||
stdout_logfile=/var/www/html/storage/logs/queue.log
|
|
||||||
stderr_logfile=/var/www/html/storage/logs/queue_error.log
|
|
||||||
|
|
||||||
[program:schedule-run]
|
|
||||||
command=cron -f
|
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
priority=3
|
|
802
package-lock.json
generated
802
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,52 +0,0 @@
|
|||||||
✅ Laravel 更新後部署流程(建議步驟)
|
|
||||||
|
|
||||||
1. 拉取新版程式碼
|
|
||||||
git pull origin main
|
|
||||||
|
|
||||||
2. 安裝依賴套件
|
|
||||||
composer install --no-dev --optimize-autoloader
|
|
||||||
|
|
||||||
cp .env.example .env
|
|
||||||
php artisan key:generate
|
|
||||||
npm install && npm run build
|
|
||||||
|
|
||||||
3. 執行資料庫 migration(如有 schema 變更)
|
|
||||||
php artisan migrate
|
|
||||||
|
|
||||||
4. 清除並重新快取設定與路由
|
|
||||||
php artisan config:clear
|
|
||||||
php artisan config:cache
|
|
||||||
php artisan route:clear
|
|
||||||
php artisan route:cache
|
|
||||||
php artisan view:clear
|
|
||||||
php artisan view:cache
|
|
||||||
|
|
||||||
5. (首次部署或有新增命令時)建立或更新任務排程 Crontab
|
|
||||||
檢查是否已有下列 crontab 設定(crontab -e):
|
|
||||||
分鐘 小時 日 月 星期 指令
|
|
||||||
* * * * * cd /path/to/your/project && php artisan schedule:run >> /dev/null 2>&1
|
|
||||||
這樣 Laravel 才能自動執行你在 routes/console.php 中定義的排程任務。
|
|
||||||
|
|
||||||
6. (選擇性)部署完立即執行某些 Artisan 指令
|
|
||||||
例如你可能希望部署後立即重建一次機器狀態資料表,可以執行:
|
|
||||||
php artisan machine_statuses:clear
|
|
||||||
|
|
||||||
7. 權限與快取設定(根據伺服器環境)
|
|
||||||
確認 storage 和 bootstrap/cache 目錄權限正確:
|
|
||||||
chmod -R 775 storage bootstrap/cache
|
|
||||||
chown -R www-data:www-data storage bootstrap/cache
|
|
||||||
|
|
||||||
✅ 完整部署腳本範例(可寫成 deploy.sh)
|
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
cd /var/www/your-project
|
|
||||||
|
|
||||||
git pull origin main
|
|
||||||
composer install --no-dev --optimize-autoloader
|
|
||||||
php artisan migrate --force
|
|
||||||
php artisan config:cache
|
|
||||||
php artisan route:cache
|
|
||||||
php artisan view:cache
|
|
||||||
php artisan machine_statuses:clear
|
|
||||||
|
|
||||||
echo "✅ Laravel 專案已更新並執行完成。"
|
|
92
開發手冊.ini
92
開發手冊.ini
@ -1,92 +0,0 @@
|
|||||||
laravel new shop_12_wireui
|
|
||||||
|
|
||||||
|
|
||||||
┌ Would you like to install a starter kit? ────────────────────┐
|
|
||||||
│ Laravel Breeze │
|
|
||||||
└──────────────────────────────────────────────────────────────┘
|
|
||||||
|
|
||||||
┌ Which Breeze stack would you like to install? ───────────────┐
|
|
||||||
│ Livewire (Volt Class API) with Alpine │
|
|
||||||
└──────────────────────────────────────────────────────────────┘
|
|
||||||
|
|
||||||
┌ Would you like dark mode support? ───────────────────────────┐
|
|
||||||
│ No │
|
|
||||||
└──────────────────────────────────────────────────────────────┘
|
|
||||||
|
|
||||||
┌ Which testing framework do you prefer? ──────────────────────┐
|
|
||||||
│ PHPUnit │
|
|
||||||
└──────────────────────────────────────────────────────────────┘
|
|
||||||
|
|
||||||
┌ Would you like to initialize a Git repository? ──────────────┐
|
|
||||||
│ ● Yes / ○ No │
|
|
||||||
└──────────────────────────────────────────────────────────────┘
|
|
||||||
|
|
||||||
|
|
||||||
composer require spatie/laravel-permission
|
|
||||||
|
|
||||||
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
php artisan make:seeder PermissionTableSeeder
|
|
||||||
php artisan make:seeder CreateAdminUserSeeder
|
|
||||||
|
|
||||||
無 DB 新建
|
|
||||||
php artisan migrate --seed
|
|
||||||
有 DB 重制
|
|
||||||
php artisan migrate:fresh --seed
|
|
||||||
|
|
||||||
valet park
|
|
||||||
valet link
|
|
||||||
valet paths
|
|
||||||
|
|
||||||
php artisan db:seed --class=PermissionTableSeeder
|
|
||||||
php artisan db:seed --class=CreateAdminUserSeeder
|
|
||||||
|
|
||||||
//console.log();
|
|
||||||
php artisan route:list
|
|
||||||
php artisan config:clear
|
|
||||||
php artisan route:clear
|
|
||||||
php artisan cache:clear
|
|
||||||
php artisan route:list
|
|
||||||
|
|
||||||
npm install && npm run build
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
composer require wireui/wireui
|
|
||||||
|
|
||||||
php artisan vendor:publish --tag="wireui.config"
|
|
||||||
|
|
||||||
php artisan make:livewire Admin/Roles/Index
|
|
||||||
|
|
||||||
php artisan make:livewire Admin/Users
|
|
||||||
|
|
||||||
php artisan make:component Table
|
|
||||||
|
|
||||||
操作記錄
|
|
||||||
composer require spatie/laravel-activitylog
|
|
||||||
php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider" --tag="activitylog-migrations"
|
|
||||||
php artisan migrate
|
|
||||||
php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider" --tag="activitylog-config"
|
|
||||||
php artisan make:model ActivityLog
|
|
||||||
|
|
||||||
Laravel Excel
|
|
||||||
composer require maatwebsite/excel
|
|
||||||
|
|
||||||
composer require power-components/livewire-powergrid
|
|
||||||
php artisan vendor:publish --tag=livewire-powergrid-config
|
|
||||||
|
|
||||||
建立分頁table
|
|
||||||
php artisan powergrid:create
|
|
||||||
|
|
||||||
|
|
||||||
php artisan make:job TransferSqliteTableJob
|
|
||||||
|
|
||||||
|
|
||||||
php artisan migrate:rollback
|
|
||||||
php artisan migrate
|
|
||||||
php artisan transfer:sqlite sqlite/tempUser.sqlite --sync
|
|
||||||
|
|
||||||
php artisan queue:work --daemon --timeout=3600 --tries=1 --queue=default
|
|
Loading…
x
Reference in New Issue
Block a user