Hi all
I’m using a mariadb service outside the egroupware docker-world.
So therefor i read your instructions in /etc/egroupware-docker/docker-compose.override.yml about how to reach this goal.
I uncommented all the lines marked by “>”
[root@mail ~]# vi /etc/egroupware-docker/docker-compose.override.yml
#########################################################################################
###
### docker-compose.override.yml file for egroupware-docker package
###
### Place all your modifications in this file, instead of /etc/egroupware-docker/docker-compose.yml.
###
### If you want to make some modification / uncomment eg. some enviroment variables, you also have to:
### - uncomment the service eg. "egroupware:", if not already uncommented like egroupware
### - uncomment the "environment:" section of the service
###
### services:
### egroupware:
### environment:
### - EGW_APC_SHM_SIZE=256M
###
### Please note: indention with space (NOT tabs!) matter in .yml files!
###
##########################################################################################
version: '3'
#volumes:
# EGroupware data stored in /var/lib/egroupware on the host
#data:
# driver_opts:
# type: none
# o: bind
# device: /var/lib/egroupware
services:
egroupware:
# egroupware images to use:
# - egroupware/egroupware: is the community edition of egroupware
# - download.egroupware.org/egroupware/epl: is the EPL / subscription version of EGroupware GmbH
# egroupware tags to use:
# - latest: recommended is to use tag latest for automatic updates incl. new stable major releases
# - 20.1: use a branch to keep on latest maintenance release for that branch, but not update automatic to next release
# - 20.1.20200613: use a maintenance release, to disable automatic updates via watchtower and run them manually
image: egroupware/egroupware:21.1
>volumes:
# if you want to use the host database:
# 1. follow instructions below to disable db service
# 2. set EGW_DB_HOST=localhost AND
# 3. uncomment the next line and modify the host path, it depends on your distro:
# - RHEL/CentOS /var/lib/mysql/mysql.sock:/var/run/mysqld/mysqld.sock
# - openSUSE/SLE /var/run/mysql/mysql.sock:/var/run/mysqld/mysqld.sock
# - Debian/Ubuntu /var/run/mysqld:/var/run/mysqld
#- /var/run/mysqld:/var/run/mysqld
> - /var/lib/mysql/mysql.sock:/var/run/mysqld/mysqld.sock
# private CA so egroupware can validate your certificate to talk to Collabora or Rocket.Chat
# multiple certificates (eg. a chain) have to be single files in a directory, with one named private-ca.crt!
#- /etc/egroupware-docker/private-ca.crt:/usr/local/share/ca-certificates/private-ca.crt:ro
> environment:
# setting a default language for a new installation
#- LANG=de
# MariaDB/MySQL host to use: for host database (socket bind-mounted into container) use "localhost"
> - EGW_DB_HOST=localhost
# for internal db service you should to specify a root password here AND in db service
# a database "egroupware" with a random password is created for you on installation (password is stored in header.inc.php in data directory)
#- EGW_DB_ROOT=root
#- EGW_DB_ROOT_PW=secret
# alternativly you can specify an already existing database with full right by the given user!
#- EGW_DB_NAME=egroupware
#- EGW_DB_USER=egroupware
> - EGW_DB_PASS=<somepassword>
# other php.ini values to set in the container and their current defaults
#- EGW_SESSION_TIMEOUT=14000
#- EGW_APC_SHM_SIZE=128M
#- EGW_MEMORY_LIMIT=128M
#- EGW_MAX_EXECUTION_TIME=90
# set the ip-address of your docker host AND your official DNS name so EGroupware
# can access Rocket.Chat or Collabora without the need to go over your firewall
#extra_hosts:
#- "my.host.name:ip-address"
# to use the database on the host, uncomment all the following settings to disable the internal db service
> db:
> image: busybox
> entrypoint: /bin/true
> restart: "no"
# push server using phpswoole
#push:
# nginx server of egroupware using /etc/egroupware-docker/egroupware-nginx.conf
# You want to install your certificate on the webserver/Nginx running on the host proxying to this one
#nginx:
# automatic updates of all containers daily at 4am
# see https://containrrr.github.io/watchtower for more information
#watchtower:
#environment:
#- WATCHTOWER_CLEANUP=true # delete old image after update to not fill up the disk
# for email notifications add your email and mail-server here
#- WATCHTOWER_NOTIFICATIONS=email
#- WATCHTOWER_NOTIFICATIONS_LEVEL=info # possible values: panic, fatal, error, warn, info or debug
#- WATCHTOWER_NOTIFICATION_EMAIL_FROM=watchtower@my-domain.com
#- WATCHTOWER_NOTIFICATION_EMAIL_TO=me@my-domain.com
#- WATCHTOWER_NOTIFICATION_EMAIL_SERVER=mail.my-domain.com # if you give your MX here, you need no user/password
#- WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=25
#- WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=watchtower@my-domain.com
#- WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=secret
#command: --schedule "0 0 4 * * *"
Then i issue following commands to stop all docker services, then start all docker services, remove orphaned db container and build images before starting containers :
[root@mail ~]# cd /etc/egroupware-docker/
[root@mail egroupware-docker]# docker-compose down
[root@mail egroupware-docker]# docker-compose up -d --remove-orphans --build
Afterwards i can see that the database connection is not possible, even the configured parameters are correct:
[root@mail egroupware-docker]# docker-compose logs -f
egroupware | Retrying EGroupware installation in 3 seconds ...
egroupware | /usr/bin/php7.4 -d memory_limit=-1 /usr/share/egroupware/setup/setup-cli.php --update 'all,admin,xxxxxxxxxx'
egroupware | EGroupware API version 21.1 found.
egroupware | EGroupware configuration file (header.inc.php) version 1.29 exists and is up to date
egroupware | Your database is not working! mysqli://egroupware:<somepassword>@db/egroupware:
egroupware |
egroupware | Installation failed --> exiting!
I noticed, that the EGW_DB_HOST and EGW_DB_PASS is not applied to the /var/lib/docker/volumes/egroupware-docker_data/_data/header.inc.php-configuration file.
I had to manually change the configuration parameters marked by “>”
[root@mail egroupware-docker]# vi /var/lib/docker/volumes/egroupware-docker_data/_data/header.inc.php
/* eGroupWare domain-specific db settings */
$GLOBALS['egw_domain']['default'] = array(
> 'db_host' => 'localhost',
'db_port' => '3306',
'db_name' => 'egroupware',
'db_user' => 'egroupware',
> 'db_pass' => '<somepass>',
// Look at the README file
'db_type' => 'mysqli',
// This will limit who is allowed to make configuration modifications
'config_user' => 'admin',
'config_passwd' => '{crypt}$2a$12$84T8C2nSxJXHpA8I5krODeB7vBF5nylW/1iZNdtea6hEOc12345.'
);
… then it worked immediately:
egroupware | [05-Jul-2021 20:42:39] NOTICE: fpm is running, pid 1
egroupware | [05-Jul-2021 20:42:39] NOTICE: ready to handle connections
egroupware | [05-Jul-2021 20:42:39] NOTICE: systemd monitor interval set to 10000ms
I tried to fix it by adding …
> 'db_host' => $_ENV["EGW_DB_HOST"],
> 'db_pass' => $_ENV["EGW_DB_PASS"],
… but it didn’t work. The logs saying:
Retrying EGroupware installation in 3 seconds ...
PHP Notice: Undefined index: EGW_DB_HOST in /var/lib/egroupware/header.inc.php on line 31
PHP Notice: Undefined index: EGW_DB_PASS in /var/lib/egroupware/header.inc.php on line 35
/usr/bin/php7.4 -d memory_limit=-1 /usr/share/egroupware/setup/setup-cli.php --update 'all,admin,xxxxxxxxxxxx;'
EGroupware API version 21.1 found.
EGroupware configuration file (header.inc.php) version 1.29 exists and is up to date
Your database is not working! mysqli://egroupware:@/egroupware:
Installation failed --> exiting!
Just as info. Not big thing.
Best regards
Tom