From 38139e353a59109f0082ade656a260028a7a4395 Mon Sep 17 00:00:00 2001 From: raquel-campuzano Date: Mon, 21 Nov 2016 14:15:05 +0100 Subject: [PATCH 1/2] Fix persistence documentation in Nami modules Fix errors in: -Run the application using Docker Compose -Persisting your application --- bitnami/parse/README.md | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/bitnami/parse/README.md b/bitnami/parse/README.md index f4ea5b98897a..5c3db1f6a0f8 100644 --- a/bitnami/parse/README.md +++ b/bitnami/parse/README.md @@ -79,44 +79,52 @@ Then you can access your application at http://your-ip/parse ## 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 `mongodb_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 Parse deployment, the above examples define docker volumes namely `mongodb_data` and `parse_data`. The Parse application state will persist as long as these volumes are not removed. + +To 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 minor change to the `docker-compose.yml` template previously shown: +```yaml version: '2' mongodb: image: 'bitnami/mongodb:latest' volumes: - '/path/to/your/local/mongodb_data:/bitnami/mongodb' - application: + parse: image: bitnami/parse:latest + depends_on: + - mongodb ports: - 1337:1337 volumes: - - '/path/to/your/local/parse_data:/bitnami/parse' - depends_on: - - mongodb + - '/path/to/parse_data:/bitnami/parse' + ``` -### 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: -1. If you haven't done this before, create a new network for the application and the database: +1. Create a network (if it does not exist): ``` - $ docker network create parse_network + $ docker network create parse-tier ``` -2. Start a MongoDB database in the previous network: +2. Create a MongoDB container with host volume: ``` - $ docker run -d --name mongodb -v /your/local/path/bitnami/mongodb:/bitnami/mongodb --network=parse_network bitnami/mongodb + $ docker run -d --name mongodb \ + --net parse-tier \ + --volume /path/to/mongodb-persistence:/bitnami/mongodb \ + bitnami/mongodb:latest ``` *Note:* You need to give the container a name in order to Parse to resolve the host @@ -124,7 +132,10 @@ In this case you need to specify the directories to mount on the run command. Th 3. Run the Parse container: ``` - $ docker run -d -p 1337:1337 --name parse -v /your/local/path/bitnami/parse:/bitnami/parse --network=parse_network bitnami/parse + $ docker run -d --name parse -p 1337:1337 \ + --net parse-tier \ + --volume /path/to/parse-persistence:/bitnami/parse \ + bitnami/parse:latest ``` # Upgrade this application From f2681271ca6482bbecd31f54c4041f6cf4ba3046 Mon Sep 17 00:00:00 2001 From: raquel-campuzano Date: Mon, 21 Nov 2016 15:41:09 +0100 Subject: [PATCH 2/2] fix error in docker-compose.yml --- bitnami/parse/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitnami/parse/README.md b/bitnami/parse/README.md index 5c3db1f6a0f8..c34cfce34723 100644 --- a/bitnami/parse/README.md +++ b/bitnami/parse/README.md @@ -104,7 +104,7 @@ version: '2' ports: - 1337:1337 volumes: - - '/path/to/parse_data:/bitnami/parse' + - '/path/to/parse-persistence:/bitnami/parse' ```