There are questions about automating the installation of onlyoffice to docker and bundles with nextcloud.

1) Configuring nginx

2) Install the onlyoffice application, connect with nextcloud

"/usr/bin/php /var/www/nextcloud/occ --no-warnings app:install onlyoffice" "/usr/bin/php /var/www/nextcloud/occ --no-warnings app:enable onlyoffice" "/usr/bin/php /var/www/nextcloud/occ --no-warnings config:app:set onlyoffice DocumentServerUrl --value=\"https://{{ hostname }}/ds-vpath/\"" "/usr/bin/php /var/www/nextcloud/occ --no-warnings config:app:set onlyoffice DocumentServerInternalUrl --value=\"http://127.0.0.1:8888/\"" "/usr/bin/php /var/www/nextcloud/occ --no-warnings config:app:set onlyoffice StorageUrl --value=\"https://{{ hostname }}/nextcloud \"" 

3) Start the document server in the docker: docker run -i -t -d -p 8888:80 --restart=always onlyoffice/documentserver

In order for the onlyoffice application to work, you need to go to nextcloud -> onlyoffice and click save. Or! It is necessary to clear the field in the database (which is a bicycle)

 update oc_appconfig set configvalue='1' where appid='onlyoffice' and configkey='settings_error'; 

Interested in the moment, not to do manual actions. Is it possible?

    1 answer 1

    You can solve your problem by adding entries to the database via occ, you need to add the following entries:

     "/usr/bin/php /var/www/nextcloud/occ --no-warnings config:app:set onlyoffice DocumentServerUrl --value=\"https://<hostname>/ds-vpath/\"" "/usr/bin/php /var/www/nextcloud/occ --no-warnings config:app:set onlyoffice DocumentServerInternalUrl --value=\"http://127.0.0.1:8888/\"" "/usr/bin/php /var/www/nextcloud/occ --no-warnings config:app:set onlyoffice StorageUrl --value=\"https://<hostname>/nextcloud/\"" "/usr/bin/php /var/www/nextcloud/occ --no-warnings config:app:set onlyoffice defFormats --value=\"{\\\"docx\\\":\\\"true\\\",\\\"xlsx\\\":\\\"true\\\",\\\"pptx\\\":\\\"true\\\",\\\"ppsx\\\":\\\"true\\\",\\\"txt\\\":\\\"false\\\",\\\"csv\\\":\\\"false\\\"}\"" "/usr/bin/php /var/www/nextcloud/occ --no-warnings config:app:set onlyoffice settings_error --value=\"\"" 

    There is a moment when you restart the container onlyoffice often crashes when starting the rabbitmq service in the container - "/ var / run / rabbitmq: Permission denied". To solve this problem, you can connect a separate container with rabbitmq and through env variables (RABBITMQ_SERVER_URL: amqp: // guest: guest @) specify where to find it, then there will be no problem with restarting the container.