Also you need to make changes to the db type and such.
For all the available configuration parameters look them here: https://helpcenter.onlyoffice.com/installation/docs-community-install-docker.aspx
Below is the complete list of parameters that can be set using environment variables.
ONLYOFFICE_HTTPS_HSTS_ENABLED: Advanced configuration option for turning off the HSTS configuration. Applicable only when SSL is in use. Defaults to true.
ONLYOFFICE_HTTPS_HSTS_MAXAGE: Advanced configuration option for setting the HSTS max-age in the onlyoffice NGINX vHost configuration. Applicable only when SSL is in use. Defaults to 31536000.
SSL_CERTIFICATE_PATH: The path to the SSL certificate to use. Defaults to /var/www/onlyoffice/Data/certs/tls.crt.
SSL_KEY_PATH: The path to the SSL certificate private key. Defaults to /var/www/onlyoffice/Data/certs/tls.key.
SSL_DHPARAM_PATH: The path to the Diffie-Hellman parameter. Defaults to /var/www/onlyoffice/Data/certs/dhparam.pem.
SSL_VERIFY_CLIENT: Enable verification of client certificates using the CA_CERTIFICATES_PATH file. Defaults to false.
DB_TYPE: The database type. Supported values are postgres, mariadb or mysql. Defaults to postgres.
DB_HOST: The IP address or the name of the host where the database server is running.
DB_PORT: The database server port number.
DB_NAME: The name of a database to be created on the image startup.
DB_USER: The new user name with superuser permissions for the database account.
DB_PWD: The password set for the database account.
AMQP_URI: The AMQP URI to connect to the message broker server.
AMQP_TYPE: The message broker type. Supported values are rabbitmq or activemq. Defaults to rabbitmq.
REDIS_SERVER_HOST: The IP address or the name of the host where the Redis server is running.
REDIS_SERVER_PORT: The Redis server port number.
NGINX_WORKER_PROCESSES: Defines the number of NGINX worker processes.
NGINX_WORKER_CONNECTIONS: Sets the maximum number of simultaneous connections that can be opened by a NGINX worker process.
JWT_ENABLED: Specifies the enabling the JSON web token validation by ONLYOFFICE Docs. Defaults to false.
JWT_SECRET: Defines the secret key to validate the JSON web token in the request to ONLYOFFICE Docs. Defaults to secret.
JWT_HEADER: Defines the HTTP header that will be used to send the JSON web token. Defaults to Authorization.
JWT_IN_BODY: Specifies the enabling the token validation in the request body to the ONLYOFFICE Docs. Defaults to false.
USE_UNAUTHORIZED_STORAGE: Set to true if using self-signed certificates for your storage server, e.g. Nextcloud. Defaults to false.
GENERATE_FONTS: When true, regenerates fonts list and the fonts thumbnails etc. at each start. Defaults to true.
METRICS_ENABLED: Specifies the enabling StatsD for ONLYOFFICE Docs. Defaults to false.
METRICS_HOST: Defines StatsD listening host. Defaults to localhost.
METRICS_PORT: Defines StatsD listening port. Defaults to 8125.
METRICS_PREFIX: Defines StatsD metrics prefix for backend services. Defaults to ds..
LETS_ENCRYPT_DOMAIN: Defines the domain for Let's Encrypt certificate.
LETS_ENCRYPT_MAIL: Defines the domain administator mail address for Let's Encrypt certificate.
Replace the MYSQL with MARIADB