From f9ffd8b585cabde70dbfea2b6c55176d15e74ba3 Mon Sep 17 00:00:00 2001 From: Mauro Torrez Date: Tue, 1 Oct 2019 00:45:28 -0300 Subject: [PATCH] fix unitd configuration --- Dockerfile | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5461b5c..796b7e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN set -ex; \ php-sqlite3 \ php-zip \ # php-imagick \ -# php-xml \ + php-xml \ # php-mbstring \ # php-curl \ ; @@ -56,26 +56,20 @@ VOLUME /tmp/roundcube-temp # launch and configure Unit RUN \ - [ -f /var/www/html/index.php ] || { \ - touch /var/www/html/index.php /var/www/html/index.php.remove; \ - } \ - && unitd --control unix:/var/run/control.unit.sock \ + [ -d /var/www/html/public_html ] || { \ + mkdir -p /var/www/html/public_html /var/www/html/public_html.remove; \ + }; \ + [ -f /var/www/html/public_html/index.php ] || { \ + touch /var/www/html/public_html/index.php /var/www/html/public_html/index.php.remove; \ + }; \ + unitd --control unix:/var/run/control.unit.sock \ && curl -X PUT --data-binary \ '{ \ "listeners": { "*:9000": { "pass": "routes" } }, \ "routes": [ \ - { "match": { "uri": "/console.php" }, "action": { "pass": "applications/direct_php" } }, \ - { "match": { "uri": "/cron.php" }, "action": { "pass": "applications/direct_php" } }, \ - { "match": { "uri": "/index.php" }, "action": { "pass": "applications/direct_php" } }, \ - { "match": { "uri": "/public.php" }, "action": { "pass": "applications/direct_php" } }, \ - { "match": { "uri": "/remote.php" }, "action": { "pass": "applications/direct_php" } }, \ - { "match": { "uri": "/status.php" }, "action": { "pass": "applications/direct_php" } }, \ - { "match": { "uri": "/version.php" }, "action": { "pass": "applications/direct_php" } }, \ - { "match": { "uri": "/core/img/*" }, "action": { "share": "/var/www/html" } }, \ - { "match": { "uri": "/core/css/*" }, "action": { "share": "/var/www/html" } }, \ - { "match": { "uri": "/core/fonts/*" }, "action": { "share": "/var/www/html" } }, \ - { "match": { "uri": "/core/js/*" }, "action": { "share": "/var/www/html" } }, \ - { "match": { "uri": "/themes/*" }, "action": { "share": "/var/www/html" } }, \ + { "match": { "uri": "/plugins/*.php" }, "action": { "pass": "applications/direct_php" } }, \ + { "match": { "uri": "/skins/*" }, "action": { "share": "/var/www/html/public_html" } }, \ + { "match": { "uri": "/program/*" }, "action": { "share": "/var/www/html/public_html" } }, \ { "action": { "pass": "applications/index_php" } } \ ], \ "applications": { \ @@ -84,7 +78,7 @@ RUN \ "processes": { "max": 20, "spare": 5 }, \ "user": "www-data", \ "group": "www-data", \ - "root": "/var/www/html", \ + "root": "/var/www/html/public_html", \ "script": "index.php" \ }, \ "direct_php": { \ @@ -92,14 +86,17 @@ RUN \ "processes": { "max": 5, "spare": 0 }, \ "user": "www-data", \ "group": "www-data", \ - "root": "/var/www/html", \ + "root": "/var/www/html/public_html", \ "index": "index.php" \ } \ } \ }' \ - --unix-socket /var/run/control.unit.sock http://localhost/config/ \ - && [ -f /var/www/html/index.php.remove ] && { \ - rm /var/www/html/index.php /var/www/html/index.php.remove; \ + --unix-socket /var/run/control.unit.sock http://localhost/config/; \ + [ -f /var/www/html/public_html/index.php.remove ] && { \ + rm /var/www/html/public_html/index.php /var/www/html/public_html/index.php.remove; \ + }; \ + [ -d /var/www/html/public_html.remove ] && { \ + rm -rf /var/www/html/public_html /var/www/html/public_html.remove; \ } WORKDIR /var/www/html