With this article you’ll learn how to prepare a Docker image of a Laravel application, push it to the registry, and use Docker in Continuous Delivery.
-
Create/download Laravel project, go to inside project
cd project -
Clone repository Laravel in Docker inside project and go to folder
docker(your can change name folder)git clone https://github.com/NdlAndrey/laravelDocker.git docker cd docker -
Set username, password and database for mysql
docker-compose.ymlmysql: environment: - "MYSQL_DATABASE=db_name" - "MYSQL_USER=homestead" - "MYSQL_PASSWORD=secret" - "MYSQL_ROOT_PASSWORD=root_secret" -
For
installorupdocker use commanddocker-compose up -dfrom docker folder (default
docker)
All docker command execute from docker folder (default
docker)
docker-compose exec app bash
docker ps
docker-compose stop
To stop single container do:
docker-compose stop {container-name}
docker-compose down
docker-compose kill
Help keeping the project development going donating a little. Thanks in advance.
Donate directly via Paypal
The Laravel framework is open-sourced software licensed under the MIT license.