DEV Community

Automata
Automata

Posted on • Edited on

Building Docker Container for a Laravel Project

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
Enter fullscreen mode Exit fullscreen mode

Or just we download it in a chosen location using following command:

git clone https://github.com/automatape/docker-laravel.git
Enter fullscreen mode Exit fullscreen mode
cd docker-laravel
Enter fullscreen mode Exit fullscreen mode

For create and start the container (in first plane)

docker-compose up
Enter fullscreen mode Exit fullscreen mode

Top comments (0)