diff --git a/Dockerfile b/Dockerfile index 5585e64..672bc47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -82,4 +82,4 @@ RUN echo "$REPO_URL" | tee /etc/apt/sources.list.d/ds.list && \ VOLUME /var/log/$COMPANY_NAME /var/lib/$COMPANY_NAME /var/www/$COMPANY_NAME/Data /var/lib/postgresql /var/lib/rabbitmq /var/lib/redis /usr/share/fonts/truetype/custom -ENTRYPOINT /app/ds/run-document-server.sh +ENTRYPOINT ["/app/ds/run-document-server.sh"] diff --git a/docker-compose.yml b/docker-compose.yml index 0c93a9f..51fafb2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,6 +24,7 @@ services: - '443:443' stdin_open: true restart: always + stop_grace_period: 60s volumes: - /var/www/onlyoffice/Data - /var/log/onlyoffice diff --git a/run-document-server.sh b/run-document-server.sh index f47662f..c3ae9e7 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -1,5 +1,11 @@ #!/bin/bash +function clean_exit { + /usr/bin/documentserver-prepare4shutdown.sh +} + +trap clean_exit SIGTERM + # Define '**' behavior explicitly shopt -s globstar @@ -522,4 +528,5 @@ service nginx start documentserver-generate-allfonts.sh ${ONLYOFFICE_DATA_CONTAINER} documentserver-static-gzip.sh ${ONLYOFFICE_DATA_CONTAINER} -tail -f /var/log/${COMPANY_NAME}/**/*.log +tail -f /var/log/${COMPANY_NAME}/**/*.log & +wait $!