This repository provides a recipe for deploying your Laravel 10 applications using Docker. The Docker setup includes Laravel 10, Alpine, Nginx, PHP-FPM, Supervisor and OPCache for optimized performance.
If you clone this repo, only Docker is required to be installed on your machine! Feel free to use and change in any way possible this template. Follow the steps below to set this up in your local environment and give it a try!
Make sure you have Docker installed on your machine. You can download it from Docker's official website.
-
Clone the repository to your local machine:
git clone https://github.com/jdsantos/laravel-alpine-nginx-phpfpm-opcache-docker.git
-
Navigate to the project directory:
cd laravel-alpine-nginx-phpfpm-opcache-docker
-
Build and run the Docker containers:
docker-compose up -d --build
-
Access your Laravel application at http://localhost:8080.
The Docker setup includes the following components:
- Alpine Linux: Lightweight Linux distribution for the base image.
- Supervisor: Process control system to manage multiple processes.
- Nginx: Web server for serving the Laravel application.
- PHP-FPM: PHP FastCGI Process Manager for handling PHP requests.
- OPCache: PHP Opcode caching for improved performance.
After cloning this repo, you should paste in your Laravel app code inside the "laravel" directory. If you prefer, copy only the following onto your project:
- Dockerfile
- entrypoint.sh
- conf.d
It should work just fine!
Any contributions to this project are more than welcome. Feel free to reach me and I will gladly include any improvements or ideas that you may have. Please, fork this repository, make any changes and submit a PR and let's get in touch!
Jorge Santos |
---|
github.com/jdsantos |
This project is open-source software licensed under the MIT license.