diff --git a/bitnami/mediawiki/README.md b/bitnami/mediawiki/README.md index bfa2e43d0098..c7026f1a75dc 100644 --- a/bitnami/mediawiki/README.md +++ b/bitnami/mediawiki/README.md @@ -78,14 +78,18 @@ 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 MediaWiki deployment, the above examples define docker volumes namely `mariadb_data` and `mediawiki_data`. The MediaWiki 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' services: @@ -93,32 +97,35 @@ services: image: 'bitnami/mariadb:latest' volumes: - '/path/to/your/local/mariadb_data:/bitnami/mariadb' - application: + mediawiki: image: 'bitnami/mediawiki:latest' + depends_on: + - mariadb ports: - '80:80' - '443:443' volumes: - - '/path/to/your/local/mediawiki_data:/bitnami/mediawiki' - - '/path/to/your/local/apache_data:/bitnami/apache' - depends_on: - - mariadb + - '/path/to/mediawiki-persistence:/bitnami/mediawiki' + - '/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: -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 mediawiki_network + $ docker network create mediawiki-tier ``` -2. Start a MariaDB database in the previous network: +2. Create a MariaDB container with host volume: ``` - $ docker run -d --name mariadb -v /your/local/path/bitnami/mariadb/data:/bitnami/mariadb/data -v /your/local/path/bitnami/mariadb/conf:/bitnami/mariadb/conf --network=mediawiki_network bitnami/mariadb + $ docker run -d --name mariadb \ + --net mediawiki-tier \ + --volume /path/to/mariadb-persistence:/bitnami/mariadb \ + bitnami/mariadb:latest ``` *Note:* You need to give the container a name in order to Mediawiki to resolve the host @@ -126,7 +133,11 @@ In this case you need to specify the directories to mount on the run command. Th 3. Run the Mediawiki container: ``` - $ docker run -d -p 80:80 --name mediawiki -v /your/local/path/bitnami/mediawiki:/bitnami/mediawiki --network=mediawiki_network bitnami/mediawiki + $ docker run -d --name mediawiki -p 80:80 -p 443:443 \ + --net mediawiki-tier \ + --volume /path/to/mediawiki-persistence:/bitnami/mediawiki \ + --volume /path/to/apache-persistence:/bitnami/apache \ + bitnami/mediawiki:latest ``` # Upgrade this application