# From Docker container
ssh -nNT -L /var/run/mysqld/mysqld.sock:remotehost:3306 -i <cert.pem> ubuntu@ssh_host
# From Docker container, php config
$db = new PDO( sprintf("mysql:unix_socket=/var/run/mysqld/mysqld.sock;dbname=%s", $config['db']['database']), $config['db']['username'], $config['db']['password']);