MediaWiki Dev Environment with docker-compose.

To read about the appcontainers/mediawiki image and learn about all of the configurable options, check out the repository and read the readme.md.

Appcontainers/mediawiki Docker Hub Repository
Appcontainers/mediawiki Quay.io Repository

1. Insure that docker/boot2docker and docker-compose are already installed on the server that you will pull the dev environment down to.

  • If your looking for additional information on installing Boot2Docker, then read the Tutorial on installing and running Boot2Docker
  • If your looking for additional information on installing docker-compose, then read the Tutorial on installing and running docker-compose
  • 2. Create a directory on the docker server or computer running boot2docker named whatever your application will be named.

    3. cd into that directory and create a file named docker-compose.yml. Copy the contents below into that file, modifying values for site names, desired ports, and passwords, and save it.

    CentOS 6.6 based version

    dbdata:
      image: appcontainers/centos66
      hostname: dbdata
      stdin_open: true
      tty: true
      volumes:
      - /var/lib
      environment:
      - ENV=production
      - TERMTAG=mw_dbdata
      command: /bin/bash
    
    db:
      image: appcontainers/mysql
      hostname: db
      stdin_open: true
      tty: true
      restart: always
      volumes_from:
      - dbdata
      environment:
      - MYSQL_USER=appadmin
      - MYSQL_PASS=adminpassword123
      - ENV=production
      - TERMTAG=mw_db
      command: /bin/bash
    
    webdata:
      image: appcontainers/mediawiki
      hostname: wpdata
      stdin_open: true
      tty: true
      volumes:
      - /var/www/html
      - /etc/pki/tls
      environment:
      - MODE=datavol
      - ENV=production
      - TERMTAG=wp_webdata
      command: /bin/bash
    
    web:
      image: appcontainers/mediawiki
      hostname: mediawiki
      stdin_open: true
      tty: true
      restart: always
      ports:
      - "80:80"
      - "443:443"
      links:
      - db
      volumes_from:
      - webdata
      environment:
      - MODE=remote
      - APP_NAME=testwiki.com
      - APACHE_SVRALIAS=www.testwiki.com localhost
      - MYSQL_SERVER=db
      - MYSQL_CLIENT=172.17.%.%
      - MYSQL_USER=appadmin
      - MYSQL_PASS=adminpassword123
      - MYSQL_DB=mediawiki
      - APP_USER=appuser
      - APP_PASS=apppass
      - ENV=production
      - TERMTAG=mediawiki
      command: /bin/bash

    Ubuntu 14.04 LTS Core based version

    dbdata:
      image: appcontainers/ubuntu1404
      hostname: dbdata
      stdin_open: true
      tty: true
      volumes:
      - /var/lib
      environment:
      - ENV=production
      - TERMTAG=mw_dbdata
      command: /bin/bash
    
    db:
      image: appcontainers/mysql-ubuntu
      hostname: db
      stdin_open: true
      tty: true
      restart: always
      volumes_from:
      - dbdata
      environment:
      - MYSQL_USER=appadmin
      - MYSQL_PASS=adminpassword123
      - ENV=production
      - TERMTAG=mw_db
      command: /bin/bash
    
    webdata:
      image: appcontainers/mediawiki-ubuntu
      hostname: wpdata
      stdin_open: true
      tty: true
      volumes:
      - /var/www/html
      - /etc/ssl
      environment:
      - MODE=datavol
      - ENV=production
      - TERMTAG=wp_webdata
      command: /bin/bash
    
    web:
      image: appcontainers/mediawiki-ubuntu
      hostname: mediawiki
      stdin_open: true
      tty: true
      restart: always
      ports:
      - "80:80"
      - "443:443"
      links:
      - db
      volumes_from:
      - webdata
      environment:
      - MODE=remote
      - APP_NAME=testwiki.com
      - APACHE_SVRALIAS=www.testwiki.com localhost
      - MYSQL_SERVER=db
      - MYSQL_CLIENT=172.17.%.%
      - MYSQL_USER=appadmin
      - MYSQL_PASS=adminpassword123
      - MYSQL_DB=mediawiki
      - APP_USER=appuser
      - APP_PASS=apppass
      - ENV=production
      - TERMTAG=mediawiki
      command: /bin/bash

    4. run docker-compose up -d to pull down and start the development environment.

    5. Go to your boot2docker/docker ip in your browser, and enjoy your app!!

    Note that you this will spin up a container of the application in datavol mode, which will remove all packages but leave the application directory structure in tact. The application front end server will then be spun up connecting the /var/www/html and /etc/pki/tls directories to the persistent data container. This way you can wipe out the front end, spin up a fresh copy of it, and all of your web data and certificate data will still be left in tact.

    0 comments