This Laravel application boilerplate is designed to kickstart your development process. It comes with an out-of-the-box Nginx configuration, Dockerized environments including PostgreSQL and RabbitMQ services, and a ready-to-go structured Dockerfile and docker-compose.yaml file.
Before you begin, ensure you have the following installed on your system:
- Docker Desktop
- Composer
- Git
Follow these steps to get your development environment up and running:
Clone this repository to your local machine using Git:
git clone https://github.com/Tope19/docker-nginx-laravel-boilerplate.git
Navigate to the cloned directory and install PHP dependencies with Composer:
composer install
Copy the example environment file to create your own .env file:
cp .env.example .env
Adjust the database and RabbitMQ credentials in your .env file to your preferred settings. Ensure these credentials match the ones defined in your docker-compose.yaml file.
Ensure your Docker Desktop application is running before proceeding to the next steps.
Build and start the Docker containers in detached mode:
docker-compose up --build -d
To migrate your database, first, find the container ID of your Laravel application:
docker ps
Then, execute the Laravel migration command within your Docker container:
docker exec <containerId> php artisan migrate
Replace with your actual Laravel application container ID.
You can follow this pattern to run other php artisan commands within your Docker container.
After completing the setup instructions, your Laravel application should be up and running within Docker containers, accessible via the configured ports.
We welcome contributions! Please feel free to submit pull requests to the repository.