Merge pull request #16 from raquel-campuzano/parse-persistence-nami
Fix persistence documentation in Nami modules
This commit is contained in:
commit
a66aaf0cc5
|
|
@ -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-persistence:/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
|
||||
|
|
|
|||
Loading…
Reference in New Issue