add unit config
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Mauro Torrez 2019-09-23 10:08:09 -03:00
parent 610713e717
commit 7b42bd2d03
8 changed files with 116 additions and 0 deletions

View File

@ -91,6 +91,35 @@ RUN set -ex; \
COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
# 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 \
&& curl -X PUT --data-binary \
'{ \
"listeners": { "*:9000": { "pass": "routes" } }, \
"routes": [ \
{ "action": { "pass": "applications/index_php" } } \
], \
"applications": { \
"index_php": { \
"type": "php", \
"processes": { "max": 20, "spare": 5 }, \
"user": "www-data", \
"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 ] && { \
rm /var/www/html/index.php /var/www/html/index.php.remove; \
}
EXPOSE 9000
ENTRYPOINT ["/entrypoint.sh"]
STOPSIGNAL SIGTERM
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]

0
14.0/unit/entrypoint.sh Normal file → Executable file
View File

View File

@ -91,6 +91,35 @@ RUN set -ex; \
COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
# 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 \
&& curl -X PUT --data-binary \
'{ \
"listeners": { "*:9000": { "pass": "routes" } }, \
"routes": [ \
{ "action": { "pass": "applications/index_php" } } \
], \
"applications": { \
"index_php": { \
"type": "php", \
"processes": { "max": 20, "spare": 5 }, \
"user": "www-data", \
"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 ] && { \
rm /var/www/html/index.php /var/www/html/index.php.remove; \
}
EXPOSE 9000
ENTRYPOINT ["/entrypoint.sh"]
STOPSIGNAL SIGTERM
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]

0
15.0/unit/entrypoint.sh Normal file → Executable file
View File

View File

@ -91,6 +91,35 @@ RUN set -ex; \
COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
# 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 \
&& curl -X PUT --data-binary \
'{ \
"listeners": { "*:9000": { "pass": "routes" } }, \
"routes": [ \
{ "action": { "pass": "applications/index_php" } } \
], \
"applications": { \
"index_php": { \
"type": "php", \
"processes": { "max": 20, "spare": 5 }, \
"user": "www-data", \
"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 ] && { \
rm /var/www/html/index.php /var/www/html/index.php.remove; \
}
EXPOSE 9000
ENTRYPOINT ["/entrypoint.sh"]
STOPSIGNAL SIGTERM
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]

0
16.0/unit/entrypoint.sh Normal file → Executable file
View File

View File

@ -90,6 +90,35 @@ RUN set -ex; \
COPY *.sh upgrade.exclude /
COPY config/* /usr/src/nextcloud/config/
# 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 \
&& curl -X PUT --data-binary \
'{ \
"listeners": { "*:9000": { "pass": "routes" } }, \
"routes": [ \
{ "action": { "pass": "applications/index_php" } } \
], \
"applications": { \
"index_php": { \
"type": "php", \
"processes": { "max": 20, "spare": 5 }, \
"user": "www-data", \
"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 ] && { \
rm /var/www/html/index.php /var/www/html/index.php.remove; \
}
EXPOSE 9000
ENTRYPOINT ["/entrypoint.sh"]
STOPSIGNAL SIGTERM
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]

0
docker-entrypoint.sh Normal file → Executable file
View File