-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config.php not updating after image rebuild #464
Comments
same problem here. i want to add redis in /usr/src/nextcloud/config/redis.config.php after first image creation. but php occ config:list don't show redis config. it's normal ? |
Yes, this is normal behaviour. The For existing instances you don't have to alter your Dockerfile. Just copy the new file into your (persistent) volume. For example:
|
I think there needs to be a separate path for image provided config files, separate from the user configuration. As a user you normally only touch config.php, and it's very confusing that "static" config files differ depending on when the installation was initially done, resulting in different behavior even if one is using the exact same versions and config.php. |
I have some difficulties to understand this. It looks like Redis isn't used by my nextcloud-apache container.
Of course all variables are included in the external env file. And this is the resulting config/config.php file:
|
The config directory is excluded from updates. If you want to activate Redis on an existing installation you have to copy the content of redis.config.php into your config.php file. You only have to copy the content lines. After that you can restart apache and it will work with your compose file.
Sent from MailDroid
…-----Original Message-----
From: unbranched <[email protected]>
To: nextcloud/docker <[email protected]>
Cc: Subscribed <[email protected]>
Sent: wo, 13 feb. 2019 10:49
Subject: Re: [nextcloud/docker] config.php not updating after image rebuild (#464)
I have some difficulties to understand this. It looks like Redis isn't used by my nextcloud-apache container.
Here is my docker-compose.yml:
`version: '3.5'
volumes:
nextcloud:
db:
services:
redis:
image: redis:alpine
restart: always
app:
image: nextcloud:${NEXTCLOUD_VERSION}
restart: always
ports:
- ${HTTP_PORT}:80
depends_on:
- db
- redis
environment:
- NEXTCLOUD_DOMAIN=${NEXTCLOUD_DOMAIN}
- NEXTCLOUD_DB_TYPE=mysql
- NEXTCLOUD_MYSQL_UTF8MB4=true
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PWD}
- MYSQL_PASSWORD=${MYSQL_PWD}
- MYSQL_DATABASE=${MYSQL_DB}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_HOST=db
- REDIS_HOST=redis
links:
- db
volumes:
- nextcloud:/var/www/html
db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PWD}
- MYSQL_PASSWORD=${MYSQL_PWD}
- MYSQL_DATABASE=${MYSQL_DB}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_HOST=db
- MARIADB_MAX_ALLOWED_PACKET=128M
- MARIADB_INNODB_LOG_FILE_SIZE=64M
volumes:
- db:/var/lib/mysql`
Of course all variables are included in the external env file.
And this is the resulting config/config.php file:
`<?php
$CONFIG = array (
'memcache.local' => '\\OC\\Memcache\\APCu',
'apps_paths' =>
array (
0 =>
array (
'path' => '/var/www/html/apps',
'url' => '/apps',
'writable' => false,
),
1 =>
array (
'path' => '/var/www/html/custom_apps',
'url' => '/custom_apps',
'writable' => true,
),
),
'instanceid' => 'ocer0rct2tum',
'passwordsalt' => 'tfdi2j5S+VjRXTiv3dbgTaC11hyY3P',
'secret' => '6H0dSvnM+PARFFdWRc6yZMICrOYe7a4J/L3JnmrbggjlR3Bk',
'trusted_domains' =>
array (
0 => 'mydomain',
),
'datadirectory' => '/var/www/html/data',
'overwrite.cli.url' => 'http://192.168.1.15:8080',
'dbtype' => 'mysql',
'version' => '15.0.4.0',
'dbname' => 'nextcloudDB',
'dbhost' => 'db',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'test',
'dbpassword' => 'test',
'logtimezone' => 'UTC',
'installed' => true,
'maintenance' => false,
'loglevel' => 2,
);`
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#464 (comment)
|
@mabkenar I just reinstalled the whole docker image using that composer.yml but Redis doesn't get automatically added to the config file. |
@unbranched I just tried your config file, I only replaced all variables with test. It worked, the redis config entries are in the new config.php.
I think you should try to start it with the variables in the docker-compose file first, and try to move them to an environment file as a second step. Good luck. Edit: do not know why the formatting fails, but it is in there..... |
I spent hours and hours debugging to figure out my config.php was outdated. It seems this bug also causes changes to the environment variables to not cause a configuration file update. Therefore Nextcloud's Docker container is not configurable the same way one would normally configure applications in Docker: by changing environment variables and restarting the container. Is there at least some way to force a reconfiguration? Manually editing config.php is a very ugly workaround, I want the environment variables given to the container to be the configuration source of truth (as they are with all other Docker containers) and avoid manual changes. |
@TheLastProject Did you find a solution? I am currently having the same problem. I basically tried everything. Deleting the complete container, clearing build cache etc. but nothing really helped. |
I ended up just manually editing config.php. I could not find any way to get Nextcloud to behave properly here. |
I suppose the problem is that the
So, if there is a Not sure, how to recreate the |
in my case, the config.php is not recreated if missing |
I suppose the config.php is only created during the initial setup. But someone would need to confirm. |
imho, modifying |
OP's question was answered years ago. This issue has morphed a bit. There are now:
There are also some potentially other topical items that those in this issue may find of interest:
|
I want to change a setting in my config.php. I'm following this example: https://github.com/nextcloud/docker/tree/master/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/app
so my dockerfile copies my config file (misc.config.php) into /usr/src/nextcloud/config/.
This works perfectly well when I initialize the service for the first time. Nextcloud somehow merges all the *.config.php files into config.php, which gets copied to the /var/www/html/ volume and all is well. However, when I change my misc.config.php file and rebuild the image, nothing happens. The file arrives safely in /usr/src/nextcloud/config/ but the change never propagates to /var/www/html/.
Am I missing something? Shouldn't this be automatic?
The text was updated successfully, but these errors were encountered: