Using a mariadb-latest Docker container with the nextcloud-latest Docker container

docker
nc15

#1

Hi,

After several unsuccessful attempts to get Nextcloud installed in a way that doesn’t leave me stuck with SQLite, I am now going to try to create & run a Nextcloud Docker container (latest) by using the Docker add-on within Plesk Onyx 17.8 (running on top of an Ubuntu 18.04 VPS with Apache 2.4.29 and PHP 7.2.14).

I have the option of first creating & running a MariaDB Docker container (latest) and then trying to set up Nextcloud to use it. The Plesk Docker add-on allows a user to tweak settings (e.g. port mapping, environment variables, etc.) before initializing the service/daemon, so I’m hoping that someone can give me advice about what I should be doing to tweak the Nextcloud and/or MariaDB container so that my first run through the web-based NC installer will connect with that db server on port 3307.

Any insight is appreciated.


#2

why do you want to change the default port of mariadb?

all you need for a setup you’ll find in the example docker compose files on github.
so it’s more or less set this three env variables for the images mariadb and nextcloud:apache. But this example is named unsecure. no https/ssl.

MYSQL_PASSWORD=
MYSQL_DATABASE=nextcloud
MYSQL_USER=nextcloud

First attempt at creating a docker-compose .yml file
#3

Thanks very much for the response. I have little experience with Docker and not much more with databases, so I appreciate any guidance. I’ll take a look at those Docker Compose files.

My VPS account has a MySQL database server running on port 3306 as the default for necessary internal databases (e.g. Plesk stuff). I want to use MariaDB instead of Oracle’s MySQL for the Nextcloud instance I’ll be installing, so I figured I’d use port 3307 so it wouldn’t conflict with Plesk’s default db server. Should I try something else?

Also, does anyone know how I might edit the MariaDB Docker container so it uses the “READ COMMITTED” transaction isolation setting per Section 10.2.1 of the Nextcloud Server Administration Manual?


#4

a) you can create a nextcloud “database” in the standard mysql “database server” as well. that’s ok. (for small installations.)
b) look at chapter “Configuration without a cnf file” here https://hub.docker.com/_/mariadb
with a docker flag you can pass settings to the mariadb in the container.
you can also create your own my.cnf file and map it into the container. that would also cover the “transaction_isolation = READ-COMMITTED” parameter. that is covered in the chapter just above “Using a custom MySQL configuration file

wrong wording/thinking.
you either use env variables or flags during container start (docker run) or you map files from the host file system into the container. but you never ever log into the container and change the setting there. these changes would be lost when you e.g. update the container.


#5

Hi Reiner_Nippes, and thanks for all the advice.

At first I was hoping to use Plesk’s Docker add-on to get these containers linked & running, but I suppose I should embrace this research spike and learn how to do things from the cli so I don’t need to rely on one hosting service’s preferred administration software.

That was indeed improper wording in my last post. I meant to say that I need to discover how to configure the proper MariaDB variables before creating/running the actual container. My Docker newbiness is showing through.

I think I will try your suggestion to create a nextcloud database on the existing MySQL server for my hosted VPS account. I anticipate fewer than two dozen concurrent nc users, at least for a while, which seems to me like a small installation.

Thanks again.