m1n64/laravel-12-docker-startup
Composer 安装命令:
composer create-project m1n64/laravel-12-docker-startup
包简介
The skeleton application for the Laravel framework.
关键字:
README 文档
README
This is a Docker-based template for Laravel 12, built with:
- PHP 8.4 (FPM on Alpine)
- PostgreSQL 16
- Redis (Alpine)
- Node.js 22 + NPM
- Supervisor for Queue & Scheduler
- Makefile for easy commands (like Laravel Sail)
- Nginx
- Composer
- XDebug in Dev Mode
And useful libraries:
🛠 Setup Instructions
1️⃣ Clone the Repository
composer create-project m1n64/laravel-12-docker-startup laravel-12-docker
cd laravel-12-docker
2️⃣ Copy .env and Update Configuration
cp .env.example .env
- Open
.envfile and change it:
DB_DATABASE=<your-db> # Change DB name
-
Change the container name prefix:
Inside
docker-compose.yml, renamel12-to your project name:
services: app: container_name: myproject-app nginx: container_name: myproject-nginx postgres: container_name: myproject-postgres redis: container_name: myproject-redis
-
Change the Docker network
In
docker-compose.yml:
networks: myproject-network:
🚀 Start Containers
🔹 Using Docker
docker-compose up -d
🔹 Using Makefile
make up # For development make prod # For production
📦 Install Dependencies
🛠 Install PHP Dependencies
Run inside the container:
docker-compose exec -u www-data app composer install
Or using Makefile:
make composer install
🎸 Install Node.js & NPM Dependencies
make npm install
make npm run dev # Run Vite for development
🔑 Generate App Key
make artisan key:generate
📜 Run Migrations
make artisan migrate
🔗 Create Storage Symlink
make artisan storage:link
💻 Available Commands
🛠 Running Laravel Commands
| Action | Docker Command | Makefile Shortcut |
|---|---|---|
Run php artisan |
docker-compose exec -u www-data app php artisan <cmd> |
make artisan <cmd> |
Run composer |
docker-compose exec -u www-data app composer <cmd> |
make composer <cmd> |
Run npm |
docker-compose exec -u www-data app npm <cmd> |
make npm <cmd> |
| Open Bash | docker-compose exec -u www-data app bash |
make bash |
| View Logs | docker-compose logs -f app |
make logs app |
| Open PostgreSQL CLI | docker-compose exec -e PGPASSWORD=<pass> postgres psql -U <user> -d <db> |
make psql |
| Open Redis CLI | docker-compose exec redis redis-cli |
make redis |
| Run Tests | docker-compose exec -u www-data app php artisan test |
make test |
🛑 Managing Containers
🔄 Restart & Stop
| Action | Docker Command | Makefile Shortcut |
|---|---|---|
| Restart all | docker-compose restart |
make restart |
| Restart one | docker-compose restart <service> |
make restart-container CONTAINER=<name> |
| Stop all | docker-compose stop |
make stop |
| Stop one | docker-compose stop <service> |
make stop-container CONTAINER=<name> |
| Start all | docker-compose up -d |
make up |
| Remove all | docker-compose down -v |
make down |
For list of all makefile commands, run make help.
💡 PHPStorm Setup
PHP Interpreter
If you use Laravel IDEA
XDebug
🧪 Run Tests
make test
or,
docker-compose exec -u www-data app php artisan test
📜 Additional Notes
- This setup supports Laravel Queues & Scheduler via Supervisor.
- PostgreSQL, Redis & Supervisor are configured out of the box.
- Uses Node.js 22 for Vite & frontend dependencies.
- All Docker volumes persist data between container restarts.
🔥 Now your Laravel 12 project is fully containerized!
Use Makefile commands just like Laravel Sail, and enjoy seamless Docker development! 🚀
🤖 Authors
m1n64/laravel-12-docker-startup 适用场景与选型建议
m1n64/laravel-12-docker-startup 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 81 次下载、GitHub Stars 达 13, 最近一次更新时间为 2025 年 02 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 m1n64/laravel-12-docker-startup 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 m1n64/laravel-12-docker-startup 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 m1n64/laravel-12-docker-startup 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
Alfabank REST API integration
High-performance, opinionated PHP 8 web framework with O(1) routing, parallel async MySQL, type-safe asset bridge, and React-island frontend
Laravel package for Accurate Online API integration.
The skeleton application for the Geoffrey agent framework.
Shared RCX Laravel DataTables UI and configuration helpers.
统计信息
- 总下载量: 81
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 13
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-27