owncloud-docker / server

Docker image for ownCloud community edition
MIT License
442 stars 127 forks source link

Changing the DB username and password makes container continuously restart #494

Open dac1976 opened 5 days ago

dac1976 commented 5 days ago

Using the 10.15 docker image and I can successfully edit the docker-compose.yml to set a custom admin user and password for owncloud server this works and I can access owncloud through a browser.

I tried to do the same sort for the DB elements so that I had stronger passwords and not use the default user name in the example yml file. But when I do this and try and start a brand new container, having remvoed all traces of any previous versions, the containers start up for the DB, Redis and owncloud but the owncloud server container keeps restarting every few seconds.

I see the following error in the log.

An unhandled exception has been thrown: Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'hgl'@'172.18.0.4' (using password: YES) in /var/www/owncloud/lib/private/DB/Connection.php:62

Here is the yml file I was using with my alterations (I am using a .env file as well)

volumes: files: driver: local mysql: driver: local redis: driver: local

services: owncloud: image: owncloud/server:${OWNCLOUD_VERSION} # by default we were 10.15 container_name: owncloud_server restart: always ports:

And here is my redacted .env file:

OWNCLOUD_VERSION=10.15 OWNCLOUD_DOMAIN=XXXXX OWNCLOUD_TRUSTED_DOMAINS=XXXXX,YYYYY DB_NAME=owncloud DB_USERNAME=xxx DB_PASSWORD=yyyyyyyyyy DB_ROOT_PASSWORD=zzzzzzzzzz ADMIN_USERNAME=tttt ADMIN_PASSWORD=wwwwwwwwww HTTP_PORT=8189 MARIADB_VERSION=10.11 REDIS_VERSION=6