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-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
|
||||
|
Loading…
x
Reference in New Issue
Block a user