You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-4Lines changed: 23 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant.
58
58
- [Install xDebug](#Install-xDebug)
59
59
- [Start/Stop xDebug](#Controll-xDebug)
60
60
- [Production](#Production)
61
+
- [Prepare LaraDock for Production](#LaraDock-for-Production)
61
62
- [Setup Laravel and Docker on Digital Ocean](#Digital-Ocean)
62
63
- [Misc](#Misc)
63
64
- [Cron jobs](#CronJobs)
@@ -922,6 +923,26 @@ To controll the behavior of xDebug (in the `php-fpm` Container), you can run the
922
923
923
924
924
925
926
+
<br>
927
+
<a name="LaraDock-for-Production"></a>
928
+
### Prepare LaraDock for Production
929
+
930
+
It's recommended for production to create a custom `docker-compose.yml` file. For that reason LaraDock is shipped with `production-docker-compose.yml` which should contain only the containers you are planning to run on production (usage exampe: `docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...`).
931
+
932
+
Note: The Database (MySQL/MariaDB/...) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:
933
+
934
+
```
935
+
ports:
936
+
- "3306:3306"
937
+
```
938
+
939
+
To learn more about how Docker publishes ports, please read [this excellent post on the subject](https://fralef.me/docker-and-iptables.html).
940
+
941
+
942
+
943
+
944
+
945
+
925
946
<br>
926
947
<a name="Digital-Ocean"></a>
927
948
### Setup Laravel and Docker on Digital Ocean
@@ -954,14 +975,12 @@ You can add your cron jobs to `workspace/crontab/root` after the `php artisan` l
954
975
<a name="MySQL-access-from-host"></a>
955
976
### MySQL access from host
956
977
957
-
You can forward the MySQL/MariaDB port to your host by adding the lines
978
+
You can forward the MySQL/MariaDB port to your host by making sure these lines are added to the `mysql` or `mariadb` section of the `docker-compose.yml` or in your [environment specific Compose](https://docs.docker.com/compose/extends/) file.
979
+
958
980
```
959
981
ports:
960
982
- "3306:3306"
961
983
```
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).
0 commit comments