update dockerfiles, clean up

This commit is contained in:
Wonderfall
2017-01-16 22:13:29 +01:00
parent b444049489
commit 77fee1694f
52 changed files with 1458 additions and 32 deletions

View File

@ -0,0 +1,54 @@
FROM alpine:edge
MAINTAINER Wonderfall <wonderfall@schrodinger.io>
ARG GPG_rainloop="3B79 7ECE 694F 3B7B 70F3 11A4 ED7C 49D9 87DA 4591"
ENV UID=991 GID=991
RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& apk -U add \
gnupg \
nginx \
s6 \
su-exec \
php7-fpm@commuedge \
php7-curl@commuedge \
php7-iconv@commuedge \
php7-xml@commuedge \
php7-dom@commuedge \
php7-openssl@commuedge \
php7-json@commuedge \
php7-zlib@commuedge \
php7-pdo_mysql@commuedge \
php7-pdo_pgsql@commuedge \
php7-pdo_sqlite@commuedge \
php7-sqlite3@commuedge \
&& cd /tmp \
&& wget -q http://repository.rainloop.net/v2/webmail/rainloop-community-latest.zip \
&& wget -q http://repository.rainloop.net/v2/webmail/rainloop-community-latest.zip.asc \
&& wget -q http://repository.rainloop.net/RainLoop.asc \
&& echo "Verifying authenticity of rainloop-community-latest.zip using GPG..." \
&& gpg --import RainLoop.asc \
&& FINGERPRINT="$(LANG=C gpg --verify rainloop-community-latest.zip.asc rainloop-community-latest.zip 2>&1 \
| sed -n "s#Primary key fingerprint: \(.*\)#\1#p")" \
&& if [ -z "${FINGERPRINT}" ]; then echo "Warning! Invalid GPG signature!" && exit 1; fi \
&& if [ "${FINGERPRINT}" != "${GPG_rainloop}" ]; then echo "Warning! Wrong GPG fingerprint!" && exit 1; fi \
&& echo "All seems good, now unzipping rainloop-community-latest.zip..." \
&& mkdir /rainloop && unzip -q /tmp/rainloop-community-latest.zip -d /rainloop \
&& find /rainloop -type d -exec chmod 755 {} \; \
&& find /rainloop -type f -exec chmod 644 {} \; \
&& apk del gnupg \
&& rm -rf /tmp/* /var/cache/apk/* /root/.gnupg
COPY nginx.conf /etc/nginx/nginx.conf
COPY php-fpm.conf /etc/php7/php-fpm.conf
COPY s6.d /etc/s6.d
COPY run.sh /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/run.sh /etc/s6.d/*/* /etc/s6.d/.s6-svscan/*
VOLUME /rainloop/data
EXPOSE 8888
CMD ["run.sh"]

View File

@ -0,0 +1,29 @@
## wonderfall/rainloop
![](https://i.goopics.net/nI.png)
#### What is this?
Rainloop is a simple, modern & fast web-based client. More info on the [official website](http://www.rainloop.net/).
#### Features
- Based on Alpine 3.3
- Latest Rainloop **Community Edition**
- Contacts (DB) : sqlite, or mysql (server not built-in)
- nginx + PHP7
#### Build-time variables
- **GPG_rainloop** : fingerprint of signing key
#### Environment variables
- **GID** : rainloop group id *(default : 991)*
- **UID** : rainloop user id *(default : 991)*
#### Volumes
- **/rainloop/data** : data files.
#### Ports
- **8888***
#### Reverse proxy
https://github.com/Wonderfall/dockerfiles/tree/master/reverse
https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration

View File

@ -0,0 +1,76 @@
worker_processes auto;
pid /tmp/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 /tmp/ngx_error.log error;
sendfile on;
keepalive_timeout 15;
keepalive_disable msie6;
keepalive_requests 100;
tcp_nopush on;
tcp_nodelay on;
server_tokens off;
fastcgi_temp_path /tmp/fastcgi 1 2;
client_body_temp_path /tmp/client_body 1 2;
proxy_temp_path /tmp/proxy 1 2;
uwsgi_temp_path /tmp/uwsgi 1 2;
scgi_temp_path /tmp/scgi 1 2;
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 8888;
root /rainloop;
index index.php index.html;
location ^~ /data {
deny all;
}
location / {
try_files $uri $uri/ index.php;
}
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}
}

View File

@ -0,0 +1,11 @@
[global]
daemonize = no
[www]
listen = /tmp/php-fpm.sock
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
chdir = /

View File

@ -0,0 +1,3 @@
#!/bin/sh
chown -R $UID:$GID /rainloop /etc/nginx /etc/php7 /var/log /var/lib/nginx /tmp /etc/s6.d
exec su-exec $UID:$GID /bin/s6-svscan /etc/s6.d

View File

@ -0,0 +1,3 @@
#!/bin/sh
exit 0

View File

@ -0,0 +1,2 @@
#!/bin/sh
exec nginx

View File

@ -0,0 +1,2 @@
#!/bin/sh
exec php-fpm7