I've been experimenting with Docker. I have an application that is made up of two Docker containers - one has a Perl web application and the other has a MariaDB database.
I've installed both containers using the Plesk Docker extension and I can get them both up and running. I've mapped the MariaDB container's port to 13306 and I can successfully connect to the database from the command line. I've mapped the web application's port to 1702 and I can see the application running on that port, but it only ever throws errors - because it can't connect to the database. I've tried setting the DB host to both "localhost" and "127.0.0.1" and in both cases I get connection errors in the logs.
Alternatively, I have a Docker compose definition that runs successfully, but I can't see any way to run docker-compose under Plesk. Am I missing something obvious?
Thanks for your help.
Dave...
I've installed both containers using the Plesk Docker extension and I can get them both up and running. I've mapped the MariaDB container's port to 13306 and I can successfully connect to the database from the command line. I've mapped the web application's port to 1702 and I can see the application running on that port, but it only ever throws errors - because it can't connect to the database. I've tried setting the DB host to both "localhost" and "127.0.0.1" and in both cases I get connection errors in the logs.
DBI Connection failed: DBI connect('host=localhost;database=succession;port=13306','succession',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at /succession/local/lib/perl5/DBIx/Class/Storage/DBI.pm line 1517.
On my laptop, I have this working successfully, but I had to add --network="host" to the docker run command in order to get it to work. How do I get host networking working on Docker containers running under Plesk?
Alternatively, I have a Docker compose definition that runs successfully, but I can't see any way to run docker-compose under Plesk. Am I missing something obvious?
Thanks for your help.
Dave...