Merge pull request #351 from philtrep/readme-mysql-host-access

Added instructions for forward the MySQL/MariaDB port to README
This commit is contained in:
Philippe Trépanier 2016-10-09 13:57:57 -04:00 committed by GitHub
commit 3abb6152c8

View File

@ -61,6 +61,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant.
- [Setup Laravel and Docker on Digital Ocean](#Digital-Ocean) - [Setup Laravel and Docker on Digital Ocean](#Digital-Ocean)
- [Misc](#Misc) - [Misc](#Misc)
- [Cron jobs](#CronJobs) - [Cron jobs](#CronJobs)
- [MySQL access from host](#MySQL-access-from-host)
- [Use custom Domain](#Use-custom-Domain) - [Use custom Domain](#Use-custom-Domain)
- [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install) - [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install)
- [Install Prestissimo](#Install-Prestissimo) - [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 * * * * * root echo "Every Minute" > /var/log/cron.log 2>&1
``` ```
<a name="MySQL-access-from-host"></a>
### 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).
<a name="Use-custom-Domain"></a> <a name="Use-custom-Domain"></a>
### Use custom Domain (instead of the Docker IP) ### Use custom Domain (instead of the Docker IP)