diff --git a/README.md b/README.md index 558c0e26..1df27d40 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant. - [Setup Laravel and Docker on Digital Ocean](#Digital-Ocean) - [Misc](#Misc) - [Cron jobs](#CronJobs) + - [MySQL access from host](#MySQL-access-from-host) - [Use custom Domain](#Use-custom-Domain) - [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install) - [Install Prestissimo](#Install-Prestissimo) @@ -950,6 +951,18 @@ You can add your cron jobs to `workspace/crontab/root` after the `php artisan` l * * * * * root echo "Every Minute" > /var/log/cron.log 2>&1 ``` + +### MySQL access from host + +You can forward the MySQL/MariaDB port to your host by adding the lines +``` +ports: + - "3306:3306" +``` +To the `mysql` or `mariadb` section of the LaraDock `docker-compose.yml` or in your [environment specific Compose](https://docs.docker.com/compose/extends/) file. + +The MySQL port is not forwarded by default because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. To learn more about how Docker publishes ports, please read [this excellent post on the subject](https://fralef.me/docker-and-iptables.html). + ### Use custom Domain (instead of the Docker IP)