mirror of
https://github.com/bitnami/containers.git
synced 2026-03-07 18:17:20 +08:00
Fix persistence documentation in Nami modules
Fix errors in: -Run the application using Docker Compose -Persisting your application
This commit is contained in:
@@ -81,13 +81,18 @@ If you want to run the application manually instead of using docker-compose, the
|
||||
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 `mongodb_data`, `parse_data` and `parse_dashboard_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`, `parse_data` and `parse_dashboard_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:
|
||||
```
|
||||
version: '2'
|
||||
|
||||
@@ -96,36 +101,42 @@ services:
|
||||
mongodb:
|
||||
image: 'bitnami/mongodb:latest'
|
||||
volumes:
|
||||
- '/path/to/your/local/mongodb_data:/bitnami/mongodb'
|
||||
- '/path/to/mongodb_data:/bitnami/mongodb'
|
||||
parse:
|
||||
image: 'bitnami/parse:latest'
|
||||
depends_on:
|
||||
- mongodb
|
||||
ports:
|
||||
- '1337:1337'
|
||||
volumes:
|
||||
- '/path/to/your/local/parse_data:/bitnami/parse'
|
||||
- '/path/to/parse_data:/bitnami/parse'
|
||||
application:
|
||||
image: 'bitnami/parse-dashboard:latest'
|
||||
ports:
|
||||
- '80:4040'
|
||||
volumes:
|
||||
- '/path/to/your/local/parse_dashboard_data:/bitnami/parse-dashboard'
|
||||
- '/path/to/parse_data-persistence:/bitnami/parse-data'
|
||||
- '/path/to/parse_dashboard_data-persistence:/bitnami/parse-dashboard'
|
||||
|
||||
```
|
||||
|
||||
### 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, Parse Server and the database:
|
||||
1. Create a network (if it does not exist):
|
||||
|
||||
```
|
||||
$ docker network create parse_dashboard_network
|
||||
$ docker network create parse_dashboard-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_dashboard_network bitnami/mongodb
|
||||
$ docker run -d --name mongodb \
|
||||
--net parse-dashboard-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.
|
||||
@@ -133,7 +144,10 @@ In this case you need to specify the directories to mount on the run command. Th
|
||||
3. Start a Parse Server container:
|
||||
|
||||
```
|
||||
$ docker run -d -p 1337:1337 --name parse -v /your/local/path/bitnami/parse:/bitnami/parse --network=parse_dashboard_network bitnami/parse
|
||||
$ docker run -d -name parse -p 1337:1337 \
|
||||
--net parse-dashboard-tier
|
||||
--volume /path/to/parse-persistence:/bitnami/parse \
|
||||
--volume /path/to/parse-dashboard-persistence:/bitnami/parse-dashboard \
|
||||
```
|
||||
|
||||
4. Run the Parse Dashboard container:
|
||||
|
||||
Reference in New Issue
Block a user