diff --git a/README.md b/README.md index 8ef9936f..d9b318b9 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ First, follow instructions at https://docs.docker.com to setup Docker and Docker Compose properly for your system. Then download the main configuration file: ``` -wget https://freeposte.io/docker-compose.yml +wget https://raw.githubusercontent.com/kaiyou/freeposte.io/master/docker-compose.yml ``` This file contains instructions about which containers to run and how they will @@ -53,8 +53,58 @@ as a sane default: mkdir -p /data ``` -Finally, you can run your mail server: +Otherwise, simply edit the ``docker-compose.yml`` to match your requirements. Finally, you can run your mail server: ``` docker-compose up -d ``` + +Monitoring the mail server +========================== + +Logs are managed by Docker directly. You can easily read your logs using : + +``` +docker-compose logs +``` + +Docker is able to forward logs to multiple log engines. Read the following documentation or details: https://docs.docker.com/engine/admin/logging/overview/. + +Building from source +==================== + +You can simply build all the containers from source using the ``docker-compose.yml``. First clone the Git repository: + +``` +git clone https://github.com/kaiyou/freeposte.io.git +``` + +Then build all the images : + +``` +docker-compose build +``` + +Development environment +======================= + +The administration Web interface requires a proper dev environment that can easily be setup using ``virtualenv`` (make sure you are using Python 3) : + +``` +cd admin +virtualenv . +source bin/activate +pip install -r requirements.txt +``` + +You can then export the path to the development database: + +``` +export SQLALCHEMY_DATABASE_URI=sqlite:///path/to/dev.db +``` + +And finally run the server with debug enabled: + +``` +python run.py +``` diff --git a/docker-compose.yml b/docker-compose.yml index 41b8b2d8..a05ed8bb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,60 +1,70 @@ -http: - build: nginx - env_file: freeposte.env - ports: - - "80:80" - - "443:443" - links: - - admin:admin - - webmail:webmail - volumes: - - /tmp/data/certs:/certs +version: '2' -imap: - build: dovecot - env_file: freeposte.env - ports: - - "143:143" - - "993:993" - volumes: - - /tmp/data/freeposte:/data - - /tmp/data/mail:/mail - - /tmp/data/certs:/certs +services: -smtp: - build: postfix - env_file: freeposte.env - ports: - - "25:25" - - "465:465" - - "587:587" - links: - - filter:lmtp - - imap:sasl - volumes: - - /tmp/data/freeposte:/data - - /tmp/data/logs:/logs - - /tmp/data/certs:/certs + http: + build: nginx + image: freeposte/reverse-proxy + env_file: freeposte.env + ports: + - "80:80" + - "443:443" + links: + - admin:admin + - webmail:webmail + volumes: + - /data/certs:/certs -filter: - build: amavis - env_file: freeposte.env - links: - - imap:lmtp - volumes: - - /tmp/data/filter:/data + imap: + build: dovecot + image: freeposte/dovecot + env_file: freeposte.env + ports: + - "143:143" + - "993:993" + volumes: + - /data/freeposte:/data + - /data/mail:/mail + - /data/certs:/certs -admin: - build: admin - env_file: freeposte.env - volumes: - - /tmp/data/freeposte:/data + smtp: + build: postfix + image: freeposte/postfix + env_file: freeposte.env + ports: + - "25:25" + - "465:465" + - "587:587" + links: + - filter:lmtp + - imap:sasl + volumes: + - /data/freeposte:/data + - /data/logs:/logs + - /data/certs:/certs -webmail: - build: roundcube - env_file: freeposte.env - links: - - imap:imap - - smtp:smtp - volumes: - - /tmp/data/webmail:/data + filter: + build: amavis + image: freeposte/amavis + env_file: freeposte.env + links: + - imap:lmtp + volumes: + - /data/filter:/data + + admin: + build: admin + image: freeposte/admin + env_file: freeposte.env + volumes: + - /data/freeposte:/data + + webmail: + build: roundcube + image: freeposte/roundcube + env_file: freeposte.env + links: + - imap:imap + - smtp:smtp + volumes: + - /data/webmail:/data