conf: docker

This commit is contained in:
antv
2026-07-13 10:43:05 +07:00
parent 62d922627f
commit 797689940c
2 changed files with 29 additions and 1 deletions
+28
View File
@@ -136,6 +136,34 @@ docker compose -f docker/docker-compose.phpmyadmin.yml up -d
```
Sau đó truy cập: `http://localhost:8889` để vào phpMyAdmin.
---
### 4.7 Khi cập nhật code trên server (reload)
Khi cập nhật mã nguồn (ví dụ `git pull`), cần thực hiện các lệnh sau để reload lại ứng dụng:
```bash
# 1. Pull latest code (run on host or inside container if repo mounted)
git pull origin main
# 2. Cài đặt/ cập nhật dependencies PHP
docker compose -f docker/docker-compose.yml exec app composer install --no-interaction --optimize-autoloader
# 3. Cài đặt/ cập nhật dependencies Node (nếu có thay đổi frontend)
docker compose -f docker/docker-compose.yml exec node npm install
# 4. Biên dịch lại frontend (production)
docker compose -f docker/docker-compose.yml exec node npm run build
# 5. Clear Laravel caches
docker compose -f docker/docker-compose.yml exec app php artisan config:clear
docker compose -f docker/docker-compose.yml exec app php artisan cache:clear
docker compose -f docker/docker-compose.yml exec app php artisan view:clear
docker compose -f docker/docker-compose.yml exec app php artisan route:clear
# 6. Restart containers để áp dụng thay đổi .env hoặc cấu hình mới
docker compose -f docker/docker-compose.yml restart app nginx node
```
---
## 5. Các lệnh tiện ích khác
+1 -1
View File
@@ -33,7 +33,7 @@ services:
working_dir: /var/www/html
volumes:
- ..:/var/www/html
command: sh -c "npm install && npm run build"
command: tail -f /dev/null
ports:
- "5173:5173"
networks: