Appreciate the effort and help me:
System Info - the versions i tried
- Laravel 6.2
- Mariadb (MySQL) - 10.2.26
- PHP - php:7.3.12-apache-stretch
this should work with latest versions why not check and give it a try and add an update!
Add these files into your laravel project and make sure you follow steps below.if all went well your docker container should be up and running.please update here in case you got an issue or any suggession to improve this.
- here in docker-compose.yml file ports are assigned(as 80 and 3309) to avoid conflicts with local apache and mysql server if any installed.
- if not you can use port 80:80 in port setting for laravel-app and port 3306:3306 in mariadb
- please make sure .env is updated before you build docker and custom.ini,laravel-worker.conf files available -- these are already in repo
-
run
cp .env.example .env
and make sure db settings are ok. especially DB_HOST. example settings as follow.
DB_CONNECTION=mysql DB_HOST=mariadb DB_PORT=3306 DB_DATABASE=my_db DB_USERNAME=admin DB_PASSWORD=admin
-
then need to build the docker
docker-compose build && docker-compose up -d && docker-compose logs -f
- this will take some time to get build. if all went correct the containers will be up and running.