From a21dff7235b4abbe8f7eda1d58872e42a97db893 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Wed, 26 Sep 2018 14:49:28 +0200 Subject: [PATCH] update readme | fix docker-compose --- README.md | 10 +++++++++- docker-compose.yml | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 28d9608..09c203a 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,14 @@ The **apache** and **php** configuration will be on the host machine (for easy m MariaDB will have its whole data folder (_i.e. `/var/lib/mysql`_) on the host in the _virtual_ folder to have the data remaining throughout containers. This property makes the database consistent and persistent among container creation/deletion. +> In a real-world environment, we would not store the whole data folder (in fact it would be in the _.gitignore_), but we would add a script to dump a SQL file into the database when using the environment for the first time : +> +> ```bash +> cat backup.sql | docker exec -i mariadb mysql -uroot -p +> ``` +> +> Then, the volumes would be shared and persistent on the host. + ###### c) Log files @@ -71,7 +79,7 @@ The whole system will only expose its port `8080` ; > We do not use the default HTTP port not to break a possible web server on the host. -Containers between them will be connected through the `privnet` network which is unreachable from the host ; except for the port 8080. +Containers between them will be connected through the `privnet` network which is also reachable from the host ; except for the port 8080. diff --git a/docker-compose.yml b/docker-compose.yml index d071f57..dd5f35d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,7 @@ services: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: vhost MYSQL_USER: php - MYSQL_PASSWORD: 4JB1dtbrIC8pT935 + MYSQL_PASSWORD: Ew1RmFFqeZOA1zwkJkocAjmepQA4JmnUW0nqDFh79jHY8aubtPO_12E9wgbNvScX0Uiv1GuUllb8YCJ00PAoh0fvNS volumes: - ./virtual/var/lib/mysql:/var/lib/mysql networks: