Feature/Add supervisor services (#517)

* Add supervisor services

* Add installation of the DOCKER_INSTALLATION variable
This commit is contained in:
Evgeniy Antonyuk 2022-10-31 17:19:10 +03:00 committed by GitHub
parent 784ecca724
commit 6c0c7085c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 58 additions and 0 deletions

@ -86,6 +86,7 @@ RUN PACKAGE_FILE="${COMPANY_NAME}-${PRODUCT_NAME}${PRODUCT_EDITION}${PACKAGE_VER
wget -q -P /tmp "$PACKAGE_BASEURL/$PACKAGE_FILE" && \
apt-get -y update && \
service postgresql start && \
export DOCKER_INSTALLATION=1 && \
apt-get -yq install /tmp/$PACKAGE_FILE && \
service postgresql stop && \
service supervisor stop && \

@ -0,0 +1,13 @@
[program:converter]
command=/var/www/COMPANY_NAME/documentserver/server/FileConverter/converter
directory=/var/www/COMPANY_NAME/documentserver/server/FileConverter
user=ds
environment=NODE_ENV=production-linux,NODE_CONFIG_DIR=/etc/COMPANY_NAME/documentserver,NODE_DISABLE_COLORS=1,APPLICATION_NAME=COMPANY_NAME
stdout_logfile=/var/log/COMPANY_NAME/documentserver/converter/out.log
stdout_logfile_backups=0
stdout_logfile_maxbytes=0
stderr_logfile=/var/log/COMPANY_NAME/documentserver/converter/err.log
stderr_logfile_backups=0
stderr_logfile_maxbytes=0
autostart=true
autorestart=true

@ -0,0 +1,13 @@
[program:docservice]
command=/var/www/COMPANY_NAME/documentserver/server/DocService/docservice
directory=/var/www/COMPANY_NAME/documentserver/server/DocService
user=ds
environment=NODE_ENV=production-linux,NODE_CONFIG_DIR=/etc/COMPANY_NAME/documentserver,NODE_DISABLE_COLORS=1
stdout_logfile=/var/log/COMPANY_NAME/documentserver/docservice/out.log
stdout_logfile_backups=0
stdout_logfile_maxbytes=0
stderr_logfile=/var/log/COMPANY_NAME/documentserver/docservice/err.log
stderr_logfile_backups=0
stderr_logfile_maxbytes=0
autostart=true
autorestart=true

@ -0,0 +1,14 @@
[program:example]
command=/var/www/COMPANY_NAME/documentserver-example/example
directory=/var/www/COMPANY_NAME/documentserver-example/
user=ds
environment=NODE_ENV=production-linux,NODE_CONFIG_DIR=/etc/COMPANY_NAME/documentserver-example,NODE_DISABLE_COLORS=1
stdout_logfile=/var/log/COMPANY_NAME/documentserver-example/out.log
stdout_logfile_backups=0
stdout_logfile_maxbytes=0
stderr_logfile=/var/log/COMPANY_NAME/documentserver-example/err.log
stderr_logfile_backups=0
stderr_logfile_maxbytes=0
autostart=false
autorestart=true
redirect_stderr=true

@ -0,0 +1,13 @@
[program:metrics]
command=/var/www/COMPANY_NAME/documentserver/server/Metrics/metrics ./config/config.js
directory=/var/www/COMPANY_NAME/documentserver/server/Metrics
user=ds
environment=NODE_DISABLE_COLORS=1
stdout_logfile=/var/log/COMPANY_NAME/documentserver/metrics/out.log
stdout_logfile_backups=0
stdout_logfile_maxbytes=0
stderr_logfile=/var/log/COMPANY_NAME/documentserver/metrics/err.log
stderr_logfile_backups=0
stderr_logfile_maxbytes=0
autostart=true
autorestart=true

@ -0,0 +1,2 @@
[group:ds]
programs=docservice,converter,metrics,example

@ -496,6 +496,8 @@ update_supervisor_settings(){
cp ${SYSCONF_TEMPLATES_DIR}/supervisor/supervisor /etc/init.d/
# Copy modified supervisor config
cp ${SYSCONF_TEMPLATES_DIR}/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
sed "s/COMPANY_NAME/${COMPANY_NAME}/g" -i ${SYSCONF_TEMPLATES_DIR}/supervisor/ds/*.conf
cp ${SYSCONF_TEMPLATES_DIR}/supervisor/ds/*.conf etc/supervisor/conf.d/
}
update_log_settings(){