diff --git a/Dockerfile-unit.template b/Dockerfile-unit.template index e62457c..bc6efcb 100644 --- a/Dockerfile-unit.template +++ b/Dockerfile-unit.template @@ -102,8 +102,11 @@ RUN \ && unitd --control unix:/var/run/control.unit.sock \ && curl -X PUT --data-binary \ '{ \ - "listeners": { "*:9000": { "pass": "routes" } }, \ - "routes": [ \ + "listeners": { "*:9000": { "pass": "routes/main" } }, \ + "listeners": { "*:9001": { "pass": "routes/dynamic" } }, \ + "listeners": { "*:9002": { "pass": "routes/static" } }, \ + "routes": {\ + "main": [ \ { "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" } }, \ @@ -118,6 +121,13 @@ RUN \ { "match": { "uri": "/themes/*" }, "action": { "share": "/var/www/html" } }, \ { "action": { "pass": "applications/index_php" } } \ ], \ + "static": [ + { "action": { "share": "/var/www/html" } } \ + ], + "dynamic": [ + { "action": { "pass": "applications/index_php" } } \ + ], + }, "applications": { \ "index_php": { \ "type": "php", \ @@ -142,7 +152,7 @@ RUN \ rm /var/www/html/index.php /var/www/html/index.php.remove; \ } -EXPOSE 9000 +EXPOSE 9000 9001 9002 ENTRYPOINT ["/entrypoint.sh"] STOPSIGNAL SIGTERM CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]