This repository contains a Laravel 11 application pre-configured to run inside a Docker environment. It includes all the necessary services and configurations to quickly start development or deployment.
- Laravel 11: The latest version of Laravel.
- Jetstream authentication: The latest version of Laravel jetstrream.
- Dockerized Environment: Includes PHP, Nginx, Reids , MySQL and other essential services.
- Ease of Use: Simple setup with
docker-compose
. - Ready for Development and Deployment.
Ensure you have the following installed on your system:
git clone https://github.com/Samuelamin/dockerized-laravel-11
cd dockerized-laravel-11
Copy the .env.example
to .env
and configure it as needed:
cp .env.example .env
Make sure the database credentials in
.env
match thedocker-compose.yml
configuration.
Run the following command to build and start the application:
docker-compose up -d
Run the following command inside the PHP container to install Laravel dependencies:
docker exec -it php-container-name composer install
Inside the PHP container, generate the Laravel application key:
docker exec -it php-container-name php artisan key:generate
- Visit the application in your browser at: http://localhost:8000
- Use a database client like phpMyAdmin or MySQL Workbench.
- Host:
localhost
- Port:
3306
- Username and Password: As configured in
.env
To stop the Docker containers:
docker-compose down
- PHP: Runs Laravel.
- Nginx: Serves the Laravel application.
- MySQL: Database server.
- Redis : For caching and queues.
- PhpMyAdmin (optional): For mysql ui.
- If you encounter permission issues, run:
sudo chown -R $USER:$USER .
- To clear caches:
docker exec -it php-container-name php artisan cache:clear
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License.