https://github.com/cbouvat/docker-laravel
All-in-one docker-compose configuration for Laravel with Nginx, PHP-fpm, Xdebug, PostgreSQL, MailPit, Node ...
https://github.com/cbouvat/docker-laravel
composer docker laravel nodejs php postgresql
Last synced: about 1 year ago
JSON representation
All-in-one docker-compose configuration for Laravel with Nginx, PHP-fpm, Xdebug, PostgreSQL, MailPit, Node ...
- Host: GitHub
- URL: https://github.com/cbouvat/docker-laravel
- Owner: cbouvat
- License: mit
- Created: 2021-08-20T11:29:43.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-01-24T16:38:41.000Z (over 1 year ago)
- Last Synced: 2025-05-02T22:07:42.093Z (about 1 year ago)
- Topics: composer, docker, laravel, nodejs, php, postgresql
- Language: Makefile
- Homepage:
- Size: 54.7 KB
- Stars: 17
- Watchers: 3
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Docker Laravel
## Requirement
- Docker engine
- Docker Compose
- Make
## Build with
- HTTP server Nginx 1.25
- PHP 8.3
- Node 20
- PostgreSQL 16 or MariaDB 11
## Install Laravel
Many commands are in `Makefile` file. Example `up`, `down`, `upgrade` and [many more 👇](#list-of-commands).
- [Download the latest release of this repository](https://github.com/cbouvat/docker-laravel/releases).
- Run this command `make install` for install Laravel with Composer
- **⚠️ Modify** environnement file `.env` create by Laravel installer with this :
```bash
DB_CONNECTION=pgsql
DB_HOST=pgsql
DB_PORT=5432
DB_DATABASE=Change this
DB_USERNAME=Change this
DB_PASSWORD=Change this
MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
```
The project is ready to use 🎉 ! Go to `http://localhost` for see the application.
## List of commands
All commands are in `Makefile` file with description. Open this file for more informations.
## Development environment
Start environment with this command `make up` and stop with `make down`. You can use `make upgrade-dev` for upgrade the environment.
### Xdebug
For Visual Studio Code, use this configuration in `.vscode/launch.json` file.
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/app": "${workspaceFolder}"
}
}
]
}
```
### Database
The database is accessible on port `5432` with this parameters :
- Host : `localhost`
- Port : `5432`
Use for example [DBeaver](https://dbeaver.io/) for connect to the database.
### Mail capture
Mailpit capture all mails form the application.
`http://localhost:8025`