commit 76c26df635bfce03f51b30df0a4ee28a27adaced Author: Hardware Date: Thu May 5 09:15:35 2016 +0200 Initial commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a912218 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,43 @@ +FROM alpine:3.3 +MAINTAINER Wonderfall +MAINTAINER Hardware + +ENV GID=991 UID=991 + +RUN echo "@commuedge http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \ + && apk -U add \ + nginx \ + php-fpm \ + php-curl \ + php-iconv \ + php-xml \ + php-dom \ + php-openssl \ + php-json \ + php-zlib \ + php-pdo_mysql \ + php-pdo_sqlite \ + php-sqlite3 \ + supervisor \ + gnupg \ + tini@commuedge \ + && wget -q http://repository.rainloop.net/v2/webmail/rainloop-community-latest.zip -P /tmp \ + && wget -q http://repository.rainloop.net/v2/webmail/rainloop-community-latest.zip.asc -P /tmp \ + && wget -q http://repository.rainloop.net/RainLoop.asc -P /tmp \ + && gpg --import /tmp/RainLoop.asc \ + && gpg --verify /tmp/rainloop-community-latest.zip.asc \ + && mkdir /rainloop && unzip -q /tmp/rainloop-community-latest.zip -d /rainloop \ + && apk del gnupg \ + && rm -rf /tmp/* /var/cache/apk/* + +COPY nginx.conf /etc/nginx/nginx.conf +COPY php-fpm.conf /etc/php/php-fpm.conf +COPY supervisord.conf /etc/supervisor/supervisord.conf +COPY startup /usr/local/bin/startup + +RUN chmod +x /usr/local/bin/startup + +VOLUME /rainloop/data +EXPOSE 80 +LABEL description "Fast, simple and modern webmail client" +CMD ["tini","--","startup"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..cad83de --- /dev/null +++ b/README.md @@ -0,0 +1,74 @@ +# hardware/rainloop + +![](https://i.goopics.net/nI.png) + +Rainloop is a SIMPLE, MODERN & FAST WEB-BASED EMAIL CLIENT. More details on the [official website](http://www.rainloop.net/). + +### Requirement + +- Docker 1.0 or higher +- MySQL (Optional, for contacts database) + +### Features +- Based on Alpine 3.3 +- Latest Rainloop **Community Edition** (stable) +- Extremely lightweight +- Contacts (DB) : sqlite, or mysql (server not built-in) + +### How to use + +``` +docker run -d \ + --name rainloop \ + --link mariadb:mariadb \ # Optional + -v /mnt/docker/rainloop:/rainloop/data \ + hardware/rainloop +``` + +### Environment variables + +- **UID** : rainloop user id (*optional*, default: 991) +- **GID** : rainloop group id (*optional*, default: 991) + +### Docker-compose + +#### Docker-compose.yml +``` +rainloop: + image: hardware/rainloop + container_name: rainloop + links: + - mariadb:mariadb + environment: + - GID=991 + - UID=991 + volumes: + - /mnt/docker/rainloop:/rainloop/data + +# if using mysql as contacts database : + +mariadb: + image: mariadb:10.1 + container_name: mariadb + volumes: + - /mnt/docker/mysql/db:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD=xxxxxxx + - MYSQL_DATABASE=rainloop + - MYSQL_USER=rainloop + - MYSQL_PASSWORD=xxxxxxx +``` + +#### Run ! + +``` +docker-compose up -d +``` + +### Reverse proxy example with nginx + +https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration + +### Initial configuration + +https://github.com/hardware/mailserver/wiki/Rainloop-initial-configuration diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..9d234f8 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,72 @@ +user rainloop; +worker_processes auto; +pid /var/run/nginx.pid; +daemon off; + +events { + worker_connections 1024; + use epoll; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + access_log off; + error_log /var/log/nginx/error.log error; + + sendfile on; + keepalive_timeout 15; + keepalive_disable msie6; + keepalive_requests 100; + tcp_nopush on; + tcp_nodelay on; + server_tokens off; + + gzip on; + gzip_comp_level 5; + gzip_min_length 512; + gzip_buffers 4 8k; + gzip_proxied any; + gzip_vary on; + gzip_disable "msie6"; + gzip_types + text/css + text/javascript + text/xml + text/plain + text/x-component + application/javascript + application/x-javascript + application/json + application/xml + application/rss+xml + application/vnd.ms-fontobject + font/truetype + font/opentype + image/svg+xml; + + server { + listen 80; + root /rainloop; + index index.php; + charset utf-8; + + location ^~ /data { + deny all; + } + + location / { + try_files $uri $uri/ index.php; + } + + location ~* \.php$ { + try_files $uri =404; + fastcgi_index index.php; + fastcgi_pass unix:/var/run/php-fpm.sock; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include /etc/nginx/fastcgi_params; + } + } + +} diff --git a/php-fpm.conf b/php-fpm.conf new file mode 100644 index 0000000..bd3f372 --- /dev/null +++ b/php-fpm.conf @@ -0,0 +1,15 @@ +[global] +daemonize = no + +[www] +user = rainloop +group = rainloop +listen = /var/run/php-fpm.sock +listen.owner = rainloop +listen.group = rainloop +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +chdir = / diff --git a/startup b/startup new file mode 100644 index 0000000..c2bbe52 --- /dev/null +++ b/startup @@ -0,0 +1,10 @@ +#!/bin/sh + +# Create user and group +addgroup -g ${GID} rainloop && adduser -h /rainloop -s /bin/sh -D -G rainloop -u ${UID} rainloop + +# Set permissions +chown -R rainloop:rainloop /rainloop /var/run/php-fpm.sock /var/lib/nginx /tmp + +# RUN ! +supervisord -c /etc/supervisor/supervisord.conf diff --git a/supervisord.conf b/supervisord.conf new file mode 100644 index 0000000..61657fa --- /dev/null +++ b/supervisord.conf @@ -0,0 +1,8 @@ +[supervisord] +nodaemon=true + +[program:php-fpm] +command=php-fpm + +[program:nginx] +command=nginx