-
-
Save gabriel-v/c6e5a1e18686f39649546c1161fadd64 to your computer and use it in GitHub Desktop.
Nextcloud Docker Autoconfiguration bug example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cp docker-compose-orig.yaml docker-compose.yaml | |
docker-compose up -d | |
# visit browser localhost:9090, it works | |
cp docker-compose-new.yaml docker-compose.yaml | |
docker-compose up -d --remove-orphans | |
docker-compose restart | |
# visit browser localhost:9090, error 500 | |
sudo cat containers/cloud/nextcloud/config/config.php | grep dbhost | |
# outputs 'dbhost' => 'db', | |
# should output: 'dbhost' => 'db2' | |
# try to fix it: install sudo | |
docker compose exec nextcloud bash -exc 'apt-get update -y && apt-get install sudo -y ' | |
docker compose exec nextcloud bash -exc 'sudo -u www-data php occ config:system:set dbhost --value db2 ' | |
# errors out with: Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for db failed: Name or service not known in /var/www/html/lib/private/DB/Connection.php:140 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
nextcloud: | |
container_name: nextcloud | |
restart: unless-stopped | |
image: nextcloud | |
ports: | |
- 9090:80 | |
volumes: | |
- ./containers/cloud/nextcloud/apps:/var/www/html/apps | |
- ./containers/cloud/nextcloud/config:/var/www/html/config | |
- ./containers/cloud/nextcloud/data:/var/www/html/data | |
- ./containers/cloud/nextcloud/themes:/var/www/html/themes | |
depends_on: | |
- db2 | |
environment: | |
NEXTCLOUD_UPDATE: 1 | |
MYSQL_HOST: db2 | |
MYSQL_DATABASE: ncdb | |
MYSQL_USER: nextcloud | |
MYSQL_PASSWORD: nextcloud | |
NEXTCLOUD_ADMIN_USER: nextcloud | |
NEXTCLOUD_ADMIN_PASSWORD: nextcloud | |
db2: | |
container_name: maria-db | |
restart: unless-stopped | |
image: mariadb | |
environment: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: ncdb | |
MYSQL_USER: nextcloud | |
MYSQL_PASSWORD: nextcloud | |
volumes: | |
- ./containers/cloud/mariadb:/var/lib/mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
nextcloud: | |
container_name: nextcloud | |
restart: unless-stopped | |
image: nextcloud | |
ports: | |
- 9090:80 | |
volumes: | |
- ./containers/cloud/nextcloud/apps:/var/www/html/apps | |
- ./containers/cloud/nextcloud/config:/var/www/html/config | |
- ./containers/cloud/nextcloud/data:/var/www/html/data | |
- ./containers/cloud/nextcloud/themes:/var/www/html/themes | |
depends_on: | |
- db | |
environment: | |
NEXTCLOUD_UPDATE: 1 | |
MYSQL_HOST: db | |
MYSQL_DATABASE: ncdb | |
MYSQL_USER: nextcloud | |
MYSQL_PASSWORD: nextcloud | |
NEXTCLOUD_ADMIN_USER: nextcloud | |
NEXTCLOUD_ADMIN_PASSWORD: nextcloud | |
db: | |
container_name: maria-db | |
restart: unless-stopped | |
image: mariadb | |
environment: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: ncdb | |
MYSQL_USER: nextcloud | |
MYSQL_PASSWORD: nextcloud | |
volumes: | |
- ./containers/cloud/mariadb:/var/lib/mysql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment