initial commit
This commit is contained in:
commit
b557c71c37
2
.gitignore
vendored
Executable file
2
.gitignore
vendored
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
*~
|
||||||
|
.DS_Store
|
35
Dockerfile
Normal file
35
Dockerfile
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
FROM thallian/php7-fpm:latest
|
||||||
|
|
||||||
|
RUN apk add --no-cache openssl tar nginx postgresql-client aspell rsyslog
|
||||||
|
RUN apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \
|
||||||
|
php7 \
|
||||||
|
php7-imap \
|
||||||
|
php7-apcu \
|
||||||
|
php7-dom \
|
||||||
|
php7-json \
|
||||||
|
php7-xml \
|
||||||
|
php7-session \
|
||||||
|
php7-pdo \
|
||||||
|
php7-pdo_pgsql \
|
||||||
|
php7-sockets \
|
||||||
|
php7-exif \
|
||||||
|
php7-iconv \
|
||||||
|
php7-openssl \
|
||||||
|
php7-mbstring \
|
||||||
|
php7-sockets \
|
||||||
|
php7-mcrypt \
|
||||||
|
php7-zip \
|
||||||
|
php7-pspell
|
||||||
|
|
||||||
|
RUN ln -s /usr/bin/php7 /usr/bin/php
|
||||||
|
|
||||||
|
RUN mkdir /var/lib/roundcube
|
||||||
|
RUN wget -qO- https://github.com/roundcube/roundcubemail/releases/download/1.2.0/roundcubemail-1.2.0-complete.tar.gz | tar xz -C /var/lib/roundcube --strip 1
|
||||||
|
RUN chown -R nginx:nginx /var/lib/roundcube
|
||||||
|
|
||||||
|
RUN mkdir /run/nginx
|
||||||
|
|
||||||
|
ADD /rootfs /
|
||||||
|
|
||||||
|
ENV FPMUSER nginx
|
||||||
|
ENV FPMGROUP nginx
|
6
rootfs/etc/confd/conf.d/config.php.toml
Normal file
6
rootfs/etc/confd/conf.d/config.php.toml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[template]
|
||||||
|
src = "config.inc.php.tmpl"
|
||||||
|
dest = "/var/lib/roundcube/config/config.inc.php"
|
||||||
|
gid = 101
|
||||||
|
uid = 100
|
||||||
|
mode = "0660"
|
3
rootfs/etc/confd/conf.d/nginx.conf.toml
Normal file
3
rootfs/etc/confd/conf.d/nginx.conf.toml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[template]
|
||||||
|
src = "nginx.conf.tmpl"
|
||||||
|
dest = "/etc/nginx/nginx.conf"
|
25
rootfs/etc/confd/templates/config.inc.php.tmpl
Normal file
25
rootfs/etc/confd/templates/config.inc.php.tmpl
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$config = array();
|
||||||
|
|
||||||
|
$config['db_dsnw'] = '{{getenv "DATABASEDSN"}}';
|
||||||
|
$config['log_driver'] = 'syslog';
|
||||||
|
|
||||||
|
$config['default_host'] = '{{getenv "IMAPHOST"}}';
|
||||||
|
|
||||||
|
$config['smtp_server'] = '{{getenv "SMTPHOST"}}';
|
||||||
|
$config['smtp_port'] = 587;
|
||||||
|
$config['smtp_user'] = '%u';
|
||||||
|
$config['smtp_pass'] = '%p';
|
||||||
|
|
||||||
|
$config['use_https'] = true;
|
||||||
|
$config['des_key'] = '{{getenv "KEY"}}';
|
||||||
|
$config['cipher_method'] = '{{getenv "CIPHERMETHOD"}}';
|
||||||
|
|
||||||
|
$config['mail_domain'] = '%t';
|
||||||
|
$config['password_charset'] = 'UTF-8';
|
||||||
|
|
||||||
|
$config['plugins'] = array('managesieve', 'password', 'archive', 'zipdownload');
|
||||||
|
|
||||||
|
$config['spellcheck_engine'] = 'pspell';
|
||||||
|
$config['default_charset'] = 'UTF-8';
|
55
rootfs/etc/confd/templates/nginx.conf.tmpl
Normal file
55
rootfs/etc/confd/templates/nginx.conf.tmpl
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
worker_processes 1;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
sendfile off;
|
||||||
|
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
gzip off;
|
||||||
|
|
||||||
|
upstream php {
|
||||||
|
server 127.0.0.1:9000;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
|
||||||
|
server_name {{ getenv "DOMAIN"}};
|
||||||
|
|
||||||
|
root /var/lib/roundcube;
|
||||||
|
index index.php index.html;
|
||||||
|
|
||||||
|
client_max_body_size 1G;
|
||||||
|
|
||||||
|
location ~ ^/(data|config|\.ht|db_structure\.xml|README|AUTHORS|COPYING-AGPL|COPYING-README) {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ index.php;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^(?<script_name>.+?\.php)(?<path_info>/.*)?$ {
|
||||||
|
try_files $script_name = 404;
|
||||||
|
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param PATH_INFO $path_info;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param HTTPS on;
|
||||||
|
fastcgi_read_timeout 300;
|
||||||
|
fastcgi_pass php_roundcube;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~* ^.+.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
|
||||||
|
expires 30d;
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
8
rootfs/etc/cont-init.d/00-roundcube
Normal file
8
rootfs/etc/cont-init.d/00-roundcube
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/with-contenv sh
|
||||||
|
|
||||||
|
#PGPASSWORD=$DBPASSWORD psql -h $DBHOST -U $DBUSER -d $DBNAME -c "SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = 'nc_appconfig')" | grep f
|
||||||
|
|
||||||
|
if [ $? -ne 1 ]; then
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
49
rootfs/etc/rsyslog.conf
Normal file
49
rootfs/etc/rsyslog.conf
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# rsyslogd.conf
|
||||||
|
#
|
||||||
|
# if you experience problems, check:
|
||||||
|
# http://www.rsyslog.com/troubleshoot
|
||||||
|
|
||||||
|
#### MODULES ####
|
||||||
|
|
||||||
|
module(load="imuxsock") # local system logging support (e.g. via logger command)
|
||||||
|
#module(load="imklog") # kernel logging support (previously done by rklogd)
|
||||||
|
module(load="immark") # --MARK-- message support
|
||||||
|
module(load="imudp") # UDP listener support
|
||||||
|
|
||||||
|
|
||||||
|
input(type="imudp" port="514")
|
||||||
|
|
||||||
|
# Log all kernel messages to the console.
|
||||||
|
# Logging much else clutters up the screen.
|
||||||
|
#kern.* action(type="omfile" file="/dev/console")
|
||||||
|
|
||||||
|
# Log anything (except mail) of level info or higher.
|
||||||
|
# Don't log private authentication messages!
|
||||||
|
*.info;mail.none;authpriv.none;cron.none action(type="omfile" file="/var/log/messages")
|
||||||
|
|
||||||
|
# The authpriv file has restricted access.
|
||||||
|
authpriv.* action(type="omfile" file="/var/log/secure")
|
||||||
|
|
||||||
|
# Log all the mail messages in one place.
|
||||||
|
mail.* action(type="omfile" file="/dev/console")
|
||||||
|
roundcube.* action(type="omfile" file="/dev/console")
|
||||||
|
|
||||||
|
# Log cron stuff
|
||||||
|
cron.* action(type="omfile" file="/var/log/cron")
|
||||||
|
|
||||||
|
# Everybody gets emergency messages
|
||||||
|
*.emerg action(type="omusrmsg" users="*")
|
||||||
|
|
||||||
|
# Save news errors of level crit and higher in a special file.
|
||||||
|
uucp,news.crit action(type="omfile" file="/var/log/spooler")
|
||||||
|
|
||||||
|
# Save boot messages also to boot.log
|
||||||
|
local7.* action(type="omfile" file="/var/log/boot.log")
|
||||||
|
|
||||||
|
# log every host in its own directory
|
||||||
|
if $fromhost-ip then /var/log/$fromhost-ip/messages
|
||||||
|
|
||||||
|
# Include all .conf files in /etc/rsyslog.d
|
||||||
|
$IncludeConfig /etc/rsyslog.d/*.conf
|
||||||
|
$template GRAYLOGRFC5424,"<%PRI%>%PROTOCOL-VERSION% %TIMESTAMP:::date-rfc3339% %HOSTNAME% %APP-NAME% %PROCID% %MSGID% %STRUCTURED-DATA% %msg%\n"
|
||||||
|
*.info;mail.none;authpriv.none;cron.none;*.* @@graylog:514;GRAYLOGRFC5424 # forward everything to remote server
|
3
rootfs/etc/services.d/nginx/run
Normal file
3
rootfs/etc/services.d/nginx/run
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/with-contenv sh
|
||||||
|
|
||||||
|
exec nginx -g "daemon off;"
|
3
rootfs/etc/services.d/rsyslog/run
Normal file
3
rootfs/etc/services.d/rsyslog/run
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/with-contenv sh
|
||||||
|
|
||||||
|
exec rsyslogd -n
|
Loading…
Reference in New Issue
Block a user