Skip to content

Installation with Docker

Fabian Wenzelmann edited this page May 3, 2017 · 3 revisions

Installation

The preferred way to use this tool is by using docker. There is a repository on Docker Hub, so you can directly pull from there.

Here is an example of a docker-compose file. First make sure to create the database or create the file mail.sql in the directory docker-entrypoint-initdb.d, the content can be found here.

version: '2'

services:
  mariadb:
    image: mariadb
    volumes:
      - ./mariadb:/var/lib/mysql
      - ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
    environment:
      - MYSQL_ROOT_PASSWORD=SOMETHINGSECRET
    ports:
      - "127.0.0.1:3306:3306"

  mailadmin:
    image: fabianwe/mailwebadmin
    volumes:
      - /var/vmail:/var/vmail
      - ./admin_config:/config
      - ./backup:/backup
    environment:
      - DB_PASSWORD=SOMETHINGSECRET
      - ADMIN_USER=admin
      - ADMIN_PASSWORD=SECRET
      - DELETE_DIRS=true
    links:
      - mariadb:mysql
    expose:
      - "80"

Of course you need the ports part only if you run your database outside of docker and want the local machine to have access to it.

The directory ./admin_config contains all your configuration files, the directory ./backup contains your backup if this is enabled.

You can also specify environment options to change the config file. This file gets created on the first startup, after that you have to change the mailconf file in the config directory. For a list of all options see here. This is the list of environment variables and how they correspond to the options in the config file. All other options are not available / will be set automatically by docker. Change the config file if you like and restart the application if you need something else.

Environment Variable Config File
DELETE_DIRS delete = true or false
ADMIN_USER admin_user
ADMIN_PASSWORD admin_password
DB_HOST host in [mysql]. Defaults to mysql
DB_PASSWORD password in [mysql]
DB_NAME dbname in [mysql]
DB_PORT port in [mysql]
SESSION_LIFESPAN session_lifespan
INVALID_KEYS_TIMER invalid_keys

Clone this wiki locally