HOWTO - What to do for having Nextcloud / OnlyOffice on the same host?

I’m really stuck now. I’m going to email support@onlyoffice.com and see if I can get some advice from the source.

I found a list of environment variables in the readme.md here: https://github.com/ONLYOFFICE/Docker-DocumentServer However I couldn’t get any of them to work in an --env-file. If I put anything in the env-file it would fail to run the webserver in the docker container.

I experimented with different settings, but this is the farthest I can get right now. I’m just going to dump my current configs here.

sudo docker run --sysctl net.ipv6.conf.all.disable_ipv6=1 --sysctl net.ipv6.conf.default.disable_ipv6=1 -i -t -d -p 8443:443 --restart=always --add-host=cloud.chillstice.com:127.0.0.1 -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data -v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice -v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql onlyoffice/documentserver

<VirtualHost *:80>
	ServerName office.chillstice.com
	ServerAlias www.office.chillstice.com
	DocumentRoot /var/www/office/public_html

	RewriteEngine On
	RewriteCond %{HTTPS} !=on
	RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] 
</VirtualHost>

<VirtualHost *:443>
	ServerAdmin chris@chillstice.com
	ServerName office.chillstice.com
    ServerAlias www.office.chillstice.com
	DocumentRoot /var/www/office/public_html

    <Directory "/var/www/office/public_html">
        	Options Indexes FollowSymLinks
            AllowOverride All
			Require all granted
    </Directory>

    <IfModule mod_headers.c>
      Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
    </IfModule>

	SSLEngine on
	SSLCertificateFile /etc/letsencrypt/live/office.chillstice.com/fullchain.pem
	SSLCertificateKeyFile /etc/letsencrypt/live/office.chillstice.com/privkey.pem
	Include /etc/letsencrypt/options-ssl-apache.conf

	#SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
	#SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
	#SSLCompression off
	#SSLHonorCipherOrder on

	SSLProxyEngine on
	#SSLProxyVerify none
	SSLProxyCheckPeerCN off
	#SSLProxyCheckPeerName off

	ProxyPassMatch (.*)(/websocket)$ "ws://127.0.0.1:8443/$1$2"
	ProxyPass / "https://127.0.0.1:8443/"
	ProxyPassReverse / "https://127.0.0.1:8443/"
	ProxyPassReverseCookieDomain https://127.0.0.1:8443 https://office.chillstice.com

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

I tried using --env-file /app/onlyoffice/env.list

ONLYOFFICE_HTTPS_HSTS_ENABLED=true
SSL_CERTIFICATE_PATH=/app/onlyoffice/DocumentServer/data/certs/onlyoffice.crt
SSL_KEY_PATH=/app/onlyoffice/DocumentServer/data/certs/onlyoffice.key
SSL_DHPARAM_PATH=/app/onlyoffice/DocumentServer/data/certs/dhparam.pem

I added this to my nextcloud config:

  'onlyoffice' =>
  array(
    'verify_peer_off' => true,
  ),