To use MySQL?
wicadmin opened this issue · 3 comments
What else change would I need to make to use MySQL as the database? I have the following:
roundcube.config.php:
<?php
$config = [];
$config['db_dsnw'] = 'mysql://mail:mail@mysql/roundcubemail';
$config['des_key'] = 'somethingsecurehere';
$config['plugins'] = [
'archive',
'zipdownload',
];
docker-compose.yml;
version: '3'
services:
roundcube:
container_name: roundcube
restart: unless-stopped
image: instrumentisto/roundcube:fpm
expose:
- "9000"
depends_on:
- mysql
volumes:
- app-volume:/app
- ./roundcube.config.php:/app/config/config.inc.php:ro
environment:
- ROUNDCUBEMAIL_DB_HOST=roundcube_mysql
- ROUNDCUBEMAIL_DB_TYPE=mysql
- ROUNDCUBEMAIL_DB_USER=mail
- ROUNDCUBEMAIL_DB_PASSWORD=mail
nginx:
container_name: roundcube_nginx
restart: unless-stopped
image: nginx:stable-alpine
depends_on:
- roundcube
ports:
- "8550:80"
volumes:
- app-volume:/var/www
- ./fpm.nginx.conf:/etc/nginx/conf.d/default.conf:ro
mysql:
image: mysql:5.7
container_name: roundcube_mysql
restart: unless-stopped
expose:
- "3306"
volumes:
- /home/rancher/myDockers/roundcube-sds/mysql:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=roundcubemail
- MYSQL_USER=mail
- MYSQL_PASSWORD=mail
volumes:
app-volume:
I am getting error:
DATABASE ERROR: CONNECTION FAILED!
Unable to connect to the database!
Please contact your server-administrator.
Pretty much the error seems to be the following but no tables are created in the database. I also verified roundcube container can ping roundcube_mysql:
Aug 10 17:28:43 06a662ed7336 user.err roundcube: <57e8bbc4> DB Error: [1146] Table 'roundcubemail.session' doesn't exist (SQL Query: SELECT `vars`, `ip`, `changed`, now() AS ts FROM `session` WHERE `sess_id` = '57e8bbc43fcd7c5ccdfc80be6ca4274b') in /app/program/lib/Roundcu
Aug 10 17:28:43 06a662ed7336 user.err roundcube: <57e8bbc4> DB Error: [1146] Table 'roundcubemail.session' doesn't exist (GET /)
172.22.0.4 - 10/Aug/2018:17:28:43 +0000 "GET /index.php" 200
Aug 10 17:28:43 06a662ed7336 user.err roundcube: <57e8bbc4> DB Error: [1146] Table 'roundcubemail.session' doesn't exist (SQL Query: INSERT INTO `session` (`sess_id`, `vars`, `ip`, `changed`) VALUES ('57e8bbc43fcd7c5ccdfc80be6ca4274b', 'dGVtcHxiOjE7bGFuZ3VhZ2V8czo1OiJlbl9V
@wicadmin it seems that you should create database by hand first:
https://github.com/roundcube/roundcubemail/wiki/Installation#database-configuration
https://github.com/roundcube/roundcubemail/blob/2fa112bd836e5e144e270bda11c9fda1a66a22ae/INSTALL#L96-L112
Use init scripts in MySQL container for that (/docker-entrypoint-initdb.d
dir).
https://hub.docker.com/_/mysql/#initializing-a-fresh-instance
Unfortunately, after spending considerable amount of time, I had to abandon this as I didn't realize roundcube was only a single email and would require multiple logins for each account.