https://github.com/nutter20912/message-board
laravel 9
https://github.com/nutter20912/message-board
docker laravel php
Last synced: 3 months ago
JSON representation
laravel 9
- Host: GitHub
- URL: https://github.com/nutter20912/message-board
- Owner: nutter20912
- Created: 2022-09-13T16:26:02.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-12T07:14:56.000Z (over 1 year ago)
- Last Synced: 2025-01-17T12:35:14.378Z (5 months ago)
- Topics: docker, laravel, php
- Language: PHP
- Homepage:
- Size: 450 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Build a simple message board app
## Packages
- [laravel/sanctum](https://github.com/laravel/sanctum)
- [DarkaOnLine/L5-Swagger](https://github.com/DarkaOnLine/L5-Swagger)
- [zircote/swagger-php](https://github.com/zircote/swagger-php)
- [laravel/horizon](https://github.com/laravel/horizon)
- [pusher/pusher-http-php](https://github.com/pusher/pusher-http-php)---
## Setup
### Config
- generate local env file
```=bash
cp .env.example .env
```- config env variable
```=env
# mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=message_board
DB_USERNAME=root
DB_PASSWORD=password# redis
REDIS_HOST=redis# queue
QUEUE_CONNECTION=redis# broadcast
BROADCAST_DRIVER=pusher# pusher
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=# l5-swagger
L5_SWAGGER_GENERATE_ALWAYS=true
```### Build
- build docker image (nginx, php-fpm, mysql, redis)
```=bash
docker-compose up -d nginx
```- create database
```=bash
//attach shell
docker exec -it sh
//connection
mysql -u root -p
//mysql cli
mysql> CREATE DATABASE {database_name};
```
- attach php-fpm container
```=bash
docker exec -it sh
//資料庫 migration
php artisan migrate// horizon static resource
php artisan horizon:install//運行 horizon
php artisan horizon
```### Test
- Coverage Report In HTML
- docker-compose.yml
```=yml
#services.php-fpm
...
environment:
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
```- attach shell && composer script
```=zh
// Generate code coverage report in HTML format
composer run test-coverage
```