dev-resources.site
for different kinds of informations.
Building Docker Container for a Laravel Project
Published at
6/24/2023
Categories
docker
laravel
beginners
devops
Author
Automata
In the first place, we need a web server that can support someone specific php version.
- Web server:
nginx
- Php version:
php-7.4
When we need two containers. We will create a docker-composer.yml
usign this structure.
# Main Directory
āāā docker-laravel
āāā docker-compose.yml
āāā README.md
āāā phpfpm
āāā Dockerfile
āāā nginx
āāā default.conf
āāā Dockerfile
āāā laravel-project # Laravel Project
āāā app.php
āāā ...
āāā composer.json
Or just we download it in a chosen location using following command:
git clone https://github.com/automatape/docker-laravel.git
cd docker-laravel
For create and start the container (in first plane)
docker-compose up
Featured ones: