fix unitd configuration
This commit is contained in:
parent
e114d5dc41
commit
f9ffd8b585
41
Dockerfile
41
Dockerfile
@ -14,7 +14,7 @@ RUN set -ex; \
|
|||||||
php-sqlite3 \
|
php-sqlite3 \
|
||||||
php-zip \
|
php-zip \
|
||||||
# php-imagick \
|
# php-imagick \
|
||||||
# php-xml \
|
php-xml \
|
||||||
# php-mbstring \
|
# php-mbstring \
|
||||||
# php-curl \
|
# php-curl \
|
||||||
;
|
;
|
||||||
@ -56,26 +56,20 @@ VOLUME /tmp/roundcube-temp
|
|||||||
|
|
||||||
# launch and configure Unit
|
# launch and configure Unit
|
||||||
RUN \
|
RUN \
|
||||||
[ -f /var/www/html/index.php ] || { \
|
[ -d /var/www/html/public_html ] || { \
|
||||||
touch /var/www/html/index.php /var/www/html/index.php.remove; \
|
mkdir -p /var/www/html/public_html /var/www/html/public_html.remove; \
|
||||||
} \
|
}; \
|
||||||
&& unitd --control unix:/var/run/control.unit.sock \
|
[ -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 \
|
&& curl -X PUT --data-binary \
|
||||||
'{ \
|
'{ \
|
||||||
"listeners": { "*:9000": { "pass": "routes" } }, \
|
"listeners": { "*:9000": { "pass": "routes" } }, \
|
||||||
"routes": [ \
|
"routes": [ \
|
||||||
{ "match": { "uri": "/console.php" }, "action": { "pass": "applications/direct_php" } }, \
|
{ "match": { "uri": "/plugins/*.php" }, "action": { "pass": "applications/direct_php" } }, \
|
||||||
{ "match": { "uri": "/cron.php" }, "action": { "pass": "applications/direct_php" } }, \
|
{ "match": { "uri": "/skins/*" }, "action": { "share": "/var/www/html/public_html" } }, \
|
||||||
{ "match": { "uri": "/index.php" }, "action": { "pass": "applications/direct_php" } }, \
|
{ "match": { "uri": "/program/*" }, "action": { "share": "/var/www/html/public_html" } }, \
|
||||||
{ "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" } }, \
|
|
||||||
{ "action": { "pass": "applications/index_php" } } \
|
{ "action": { "pass": "applications/index_php" } } \
|
||||||
], \
|
], \
|
||||||
"applications": { \
|
"applications": { \
|
||||||
@ -84,7 +78,7 @@ RUN \
|
|||||||
"processes": { "max": 20, "spare": 5 }, \
|
"processes": { "max": 20, "spare": 5 }, \
|
||||||
"user": "www-data", \
|
"user": "www-data", \
|
||||||
"group": "www-data", \
|
"group": "www-data", \
|
||||||
"root": "/var/www/html", \
|
"root": "/var/www/html/public_html", \
|
||||||
"script": "index.php" \
|
"script": "index.php" \
|
||||||
}, \
|
}, \
|
||||||
"direct_php": { \
|
"direct_php": { \
|
||||||
@ -92,14 +86,17 @@ RUN \
|
|||||||
"processes": { "max": 5, "spare": 0 }, \
|
"processes": { "max": 5, "spare": 0 }, \
|
||||||
"user": "www-data", \
|
"user": "www-data", \
|
||||||
"group": "www-data", \
|
"group": "www-data", \
|
||||||
"root": "/var/www/html", \
|
"root": "/var/www/html/public_html", \
|
||||||
"index": "index.php" \
|
"index": "index.php" \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
}' \
|
}' \
|
||||||
--unix-socket /var/run/control.unit.sock http://localhost/config/ \
|
--unix-socket /var/run/control.unit.sock http://localhost/config/; \
|
||||||
&& [ -f /var/www/html/index.php.remove ] && { \
|
[ -f /var/www/html/public_html/index.php.remove ] && { \
|
||||||
rm /var/www/html/index.php /var/www/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
|
WORKDIR /var/www/html
|
||||||
|
Loading…
x
Reference in New Issue
Block a user