internal routing in Unit, change port to 8080
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Mauro Torrez 2019-09-20 10:25:45 -03:00
parent 3993d19e97
commit 1d8ec91a4e

View File

@ -25,7 +25,6 @@ RUN { \
echo 'html_errors = Off'; \ echo 'html_errors = Off'; \
} > /etc/php/7.3/embed/conf.d/error-logging.ini } > /etc/php/7.3/embed/conf.d/error-logging.ini
VOLUME /var/www/html VOLUME /var/www/html
ENV WORDPRESS_VERSION 5.2.3 ENV WORDPRESS_VERSION 5.2.3
@ -41,7 +40,7 @@ RUN set -ex; \
chown -R www-data:www-data /var/www/html chown -R www-data:www-data /var/www/html
# port used by the listener in config.json # port used by the listener in config.json
EXPOSE 8090 8091 EXPOSE 8080
# application setup # application setup
@ -50,42 +49,36 @@ RUN \
[ -f /var/www/html/index.php ] || { \ [ -f /var/www/html/index.php ] || { \
touch /var/www/html/index.php /var/www/html/index.php.remove; \ touch /var/www/html/index.php /var/www/html/index.php.remove; \
} \ } \
&& unitd --control unix:/var/run/control.unit.sock \ && unitd --control unix:/var/run/control.unit.sock \
# upload the app config to Unit # upload the app config to Unit
&& curl -X PUT --data-binary '{ \ && curl -X PUT --data-binary \
"listeners": { \ '{ \
"*:8090": { \ "listeners": { "*:8080": { "pass": "routes" } }, \
"application": "script_index_php" \ "routes": [ \
}, \ { "match": { "uri": "*.php" }, "action": { "pass": "applications/direct_php" } }, \
"*:8091": { \ { "action": { "share": "/var/www/html" } }, \
"application": "direct_php" \ { "action": { "pass": "applications/index_php" } } \
} \ ], \
}, \ "applications": { \
"applications": { \ "index_php": { \
"script_index_php": { \ "type": "php", \
"type": "php", \ "processes": { "max": 20, "spare": 5 }, \
"processes": { \ "user": "www-data", \
"max": 20, \ "group": "www-data", \
"spare": 5 \ "root": "/var/www/html", \
}, \ "script": "index.php" \
"user": "www-data", \ }, \
"group": "www-data", \ "direct_php": { \
"root": "/var/www/html", \ "type": "php", \
"script": "index.php" \ "processes": { "max": 5, "spare": 0 }, \
}, \ "user": "www-data", \
"direct_php": { \ "group": "www-data", \
"type": "php", \ "root": "/var/www/html", \
"processes": { \ "index": "index.php" \
"max": 5, \ } \
"spare": 0 \ } \
}, \ }' \
"user": "www-data", \ --unix-socket /var/run/control.unit.sock http://localhost/config/ \
"group": "www-data", \
"root": "/var/www/html", \
"script": "index.php" \
} \
} \
}' --unix-socket /var/run/control.unit.sock http://localhost/config/ \
&& [ -f /var/www/html/index.php.remove ] && { \ && [ -f /var/www/html/index.php.remove ] && { \
rm /var/www/html/index.php /var/www/html/index.php.remove; \ rm /var/www/html/index.php /var/www/html/index.php.remove; \
} }