git subrepo clone https://github.com/silvio/hubzilla-docker.git forks/hubzilla-docker
subrepo:
subdir: "forks/hubzilla-docker"
merged: "74df054"
upstream:
origin: "https://github.com/silvio/hubzilla-docker.git"
branch: "master"
commit: "74df054"
git-subrepo:
version: "0.3.1"
origin: "???"
commit: "???"
diff --git a/forks/hubzilla-docker/.gitrepo b/forks/hubzilla-docker/.gitrepo
new file mode 100644
index 0000000..48adbf4
--- /dev/null
+++ b/forks/hubzilla-docker/.gitrepo
@@ -0,0 +1,11 @@
+; DO NOT EDIT (unless you know what you are doing)
+;
+; This subdirectory is a git "subrepo", and this file is maintained by the
+; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
+;
+[subrepo]
+ remote = https://github.com/silvio/hubzilla-docker.git
+ branch = master
+ commit = 74df054750c39c0beceea3d6f6f26e95521a3c03
+ parent = none
+ cmdver = 0.3.1
diff --git a/forks/hubzilla-docker/Dockerfile b/forks/hubzilla-docker/Dockerfile
new file mode 100644
index 0000000..a2a6df7
--- /dev/null
+++ b/forks/hubzilla-docker/Dockerfile
@@ -0,0 +1,44 @@
+
+FROM alpine:3.5
+MAINTAINER Silvio Fricke <silvio.fricke@gmail.com>
+
+ENTRYPOINT ["/start.sh"]
+VOLUME /data
+
+ADD addons/nginx-server.conf /etc/nginx/conf.d/default.conf
+ADD addons/start.sh /start.sh
+
+# useable for any git references
+ENV HUBZILLAVERSION 2.4
+
+ENV HUBZILLAINTERVAL 10
+env SERVERNAME 127.0.0.1
+
+
+RUN set -ex \
+ && apk update \
+ && apk upgrade \
+ && apk add \
+ bash \
+ curl \
+ dcron \
+ gd \
+ nginx \
+ openssl \
+ php5 \
+ php5-curl \
+ php5-fpm \
+ php5-gd \
+ php5-json \
+ php5-pdo_mysql \
+ php5-pdo_pgsql \
+ php5-openssl \
+ php5-xml \
+ php5-zip \
+ && mkdir -p /run/nginx /hubzilla \
+ && curl https://codeload.github.com/redmatrix/hubzilla/tar.gz/${HUBZILLAVERSION} | tar -xz --strip-components=1 -C /hubzilla -f - \
+ && chown nginx:nginx -R /hubzilla \
+ && chmod 0777 /hubzilla \
+ && sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/php5/php.ini \
+ && chmod u+x /start.sh \
+ && echo "*/###HUBZILLAINTERVAL### * * * * cd /hubzilla; /usr/bin/php Zotlabs/Daemon/Master.php Cron" > /hubzilla-cron.txt
diff --git a/forks/hubzilla-docker/addons/nginx-server.conf b/forks/hubzilla-docker/addons/nginx-server.conf
new file mode 100644
index 0000000..978c482
--- /dev/null
+++ b/forks/hubzilla-docker/addons/nginx-server.conf
@@ -0,0 +1,71 @@
+
+server {
+ listen 80;
+ server_name ###SERVERNAME###;
+
+ index index.php;
+ root /hubzilla;
+
+ fastcgi_param HTTP on;
+
+ charset utf-8;
+ access_log /var/log/nginx/red.log;
+
+ client_max_body_size 20m;
+ client_body_buffer_size 128k;
+
+ location / {
+ if ($is_args != "") {
+ rewrite ^/(.*) /index.php?q=$uri&$args last;
+ }
+ rewrite ^/(.*) /index.php?q=$uri last;
+ }
+
+ location ^~ /.well-known/ {
+ allow all;
+ rewrite ^/(.*) /index.php?q=$uri&$args last;
+ }
+
+ # statically serve these file types when possible
+ # otherwise fall back to front controller
+ # allow browser to cache them
+ # added .htm for advanced source code editor library
+ location ~* \.(jpg|jpeg|gif|png|ico|css|js|htm|html|map|ttf|woff|woff2|svg)$ {
+ expires 30d;
+ try_files $uri /index.php?q=$uri&$args;
+ }
+
+ # block these file types
+ location ~* \.(tpl|md|tgz|log|out)$ {
+ deny all;
+ }
+
+ # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
+ # or a unix socket
+ location ~* \.php$ {
+ try_files $uri =404;
+
+ # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
+
+ # With php5-cgi alone:
+ fastcgi_pass 127.0.0.1:9000;
+ #fastcgi_pass unix:/var/run/php5-fpm.sock;
+
+ include fastcgi_params;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+
+ # deny access to all dot files
+ location ~ /\. {
+ deny all;
+ }
+
+ #deny access to store
+
+ location ~ /store {
+ deny all;
+ }
+}
+
diff --git a/forks/hubzilla-docker/addons/start.sh b/forks/hubzilla-docker/addons/start.sh
new file mode 100644
index 0000000..086c932
--- /dev/null
+++ b/forks/hubzilla-docker/addons/start.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+[ ! -e /data/htconfig.php ] && touch /data/htconfig.php
+ln -sf /data/htconfig.php /hubzilla/.htconfig.php
+chmod -R 0777 /data/htconfig.php
+
+if [ ! -e /data/store ]; then
+ mkdir /data/store
+ ln -sf /data/store /hubzilla/store
+ mkdir -p '/data/store/[data]/smarty3'
+ chmod -R 0777 /data/store
+else
+ sed -i "s/###HUBZILLAINTERVAL###/${HUBZILLAINTERVAL}/" /hubzilla-cron.txt
+ crontab /hubzilla-cron.txt
+fi
+
+
+
+sed -i "s/###SERVERNAME###/${SERVERNAME}/" /etc/nginx/conf.d/default.conf
+
+nginx
+php-fpm
+
+tail -F /var/log/*.log /var/log/nginx/*.log
diff --git a/forks/hubzilla-docker/readme.md b/forks/hubzilla-docker/readme.md
new file mode 100644
index 0000000..c692fc7
--- /dev/null
+++ b/forks/hubzilla-docker/readme.md
@@ -0,0 +1,16 @@
+
+# introduction
+
+Dockerimage for <https://hubzilla.org>.
+
+
+# dependencies
+
+* mysql or postgres server
+
+
+# start
+
+```bash
+$ docker run --link mysqlserver -e SERVERNAME=hub.port1024.net -v ${PWD}/hubzilladata:/data -d silviof/hubzilla-docker
+```