Skip to content

Commit 3abb615

Browse files
authored
Merge pull request laradock#351 from philtrep/readme-mysql-host-access
Added instructions for forward the MySQL/MariaDB port to README
2 parents 2396b47 + 5221544 commit 3abb615

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant.
6161
- [Setup Laravel and Docker on Digital Ocean](#Digital-Ocean)
6262
- [Misc](#Misc)
6363
- [Cron jobs](#CronJobs)
64+
- [MySQL access from host](#MySQL-access-from-host)
6465
- [Use custom Domain](#Use-custom-Domain)
6566
- [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install)
6667
- [Install Prestissimo](#Install-Prestissimo)
@@ -950,6 +951,18 @@ You can add your cron jobs to `workspace/crontab/root` after the `php artisan` l
950951
* * * * * root echo "Every Minute" > /var/log/cron.log 2>&1
951952
```
952953
954+
<a name="MySQL-access-from-host"></a>
955+
### MySQL access from host
956+
957+
You can forward the MySQL/MariaDB port to your host by adding the lines
958+
```
959+
ports:
960+
- "3306:3306"
961+
```
962+
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.
963+
964+
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).
965+
953966
<a name="Use-custom-Domain"></a>
954967
### Use custom Domain (instead of the Docker IP)
955968

0 commit comments

Comments
 (0)