serve dynamic and static content on diferent ports
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Mauro Torrez 2019-10-03 08:47:26 -03:00
parent b4ea34ceee
commit d38b4cfa49

View File

@ -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"]