Fix nami modules persistence

Add missed components in manual persistence for Nami modules.
This commit is contained in:
raquel-campuzano 2016-11-17 10:30:00 +01:00
parent 486b6c2644
commit a804df962c
1 changed files with 21 additions and 11 deletions

View File

@ -77,13 +77,15 @@ Then you can access your application at http://your-ip/
## Persisting your application
If you remove every container and volume all your data will be lost, and the next time you run the image the application will be reinitialized. To avoid this loss of data, you should mount a volume that will persist even after the container is removed. If you are using docker-compose your data will be persistent as long as you don't remove `mariadb_data` and `application_data` data volumes. If you have run the containers manually or you want to mount the folders with persistent data in your host follow the next steps:
If you remove every container and volume all your data will be lost, and the next time you run the image the application will be reinitialized. To avoid this loss of data, you should mount a volume that will persist even after the container is removed. For persistence of the Drupal deployment, the above examples define docker volumes namely mariadb_data, drupal_data and apache_data. The Drupal application state will persist as long as these volumes are not removed.
If avoid inadvertent removal of these volumes you can [mount host directories as data volumes](https://docs.docker.com/engine/tutorials/dockervolumes/). Alternatively you can make use of volume plugins to host the volume data.
> **Note!** If you have already started using your application, follow the steps on [backing](#backing-up-your-application) up to pull the data from your running container down to your host.
### Mount persistent folders in the host using docker-compose
### Mount host directories as data volumes with Docker Compose
This requires a sightly modification from the template previously shown:
This requires a sightly modification from the `docker-compose.yml` template previously shown:
```yaml
version: '2'
@ -91,20 +93,21 @@ services:
mariadb:
image: 'bitnami/mariadb:latest'
volumes:
- '/path/to/your/local/mariadb_data:/bitnami/mariadb'
- '/path/to/mariadb-persistence:/bitnami/mariadb'
drupal:
image: 'bitnami/drupal:latest'
depends_on:
- mariadb
ports:
- '80:80'
- '443:443'
volumes:
- '/path/to/your/local/drupal_data:/bitnami/drupal'
- '/path/to/your/local/apache_data:/bitnami/apache'
depends_on:
- mariadb
- '/path/to/drupal-persistence:/bitnami/drupal'
- '/path/to/apache-persistence:/bitnami/apache'
```
### Mount persistent folders manually
### Mount host directories as data volumes using the Docker command line
In this case you need to specify the directories to mount on the run command. The process is the same than the one previously shown:
@ -117,7 +120,10 @@ In this case you need to specify the directories to mount on the run command. Th
2. Start a MariaDB database in the previous network:
```
$ docker run -d --name mariadb -v /your/local/path/bitnami/mariadb_data:/bitnami/mariadb --network=drupal_network bitnami/mariadb
$ docker run -d --name mariadb \
--net drupal \
--volume /path/to/mariadb-persistence:/bitnami/mariadb \
bitnami/mariadb:latest
```
*Note:* You need to give the container a name in order to Drupal to resolve the host
@ -125,7 +131,11 @@ In this case you need to specify the directories to mount on the run command. Th
3. Run the Drupal container:
```
$ docker run -d -p 80:80 --name drupal -v /your/local/path/bitnami/drupal:/bitnami/drupal --network=drupal_network bitnami/drupal
$ docker run -d -p 80:80 --name drupal -v /path/to/bitnami/drupal:/bitnami/drupal \
--network=drupal_network bitnami/drupal \
--volume /path/to/drupal-persistence:/bitnami/drupal \
--volume /path/to/apache-persistence:/bitnami/apache \
bitnami/drupal:latest
```
# Upgrade this application