Can someone please help me?
I actually have two problems with docker compose. I use Debian on a virtual machine (IP: 192.168.1.13). An Apache container acts as a relay host. (Container IP: 172.16.0.1).
Here is my docker-compose.yml:
version: "2"
volumes:
files:
driver: local
mysql:
driver: local
backup:
driver: local
redis:
driver: local
services:
owncloud:
image: owncloud/server:${OWNCLOUD_VERSION}
container_name: owncloud
restart: always
ports:
- ${HTTP_PORT}:8080
depends_on:
- ownclouddb
environment:
- OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN}
- OWNCLOUD_TRUSTED_DOMAINS=${OWNCLOUD_TRUSTED_DOMAINS}
#Database
- OWNCLOUD_DB_TYPE=mysql
- OWNCLOUD_DB_NAME=owncloud
- OWNCLOUD_DB_USERNAME=owncloud
- OWNCLOUD_DB_PASSWORD=${ADMIN_PASSWORD}
- OWNCLOUD_DB_HOST=ownclouddb
#Owncloud
- OWNCLOUD_ADMIN_USERNAME=${ADMIN_USERNAME}
- OWNCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD}
- OWNCLOUD_MYSQL_UTF8MB4=true
#Relay Proxy
- OWNCLOUD_OVERWRITE_CLI_URL=https://192.168.1.13/owncloud #Problem No. 1
- OWNCLOUD_OVERWRITE_PROTOCOL=https
- OWNCLOUD_OVERWRITE_HOST=192.168.1.13/owncloud
- OWNCLOUD_TRUSTED_PROXIES=192.168.1.13, 172.16.0.1
- OWNCLOUD_SUB_URL = /owncloud
#Container
- ImageName = owncloud.server
healthcheck:
test: ["CMD", "/usr/bin/healthcheck"]
interval: 30s
timeout: 10s
retries: 5
volumes:
- /opt/docker/owncloud/volumes/server/data:/mnt/data #Problem No. 2
networks:
net:
ipv4_address: 172.16.0.8
ownclouddb:
image: mariadb:10.11
container_name: ownclouddb
restart: always
environment:
- MYSQL_DATABASE=owncloud
- MYSQL_USER=owncloud
- MYSQL_PASSWORD=${ADMIN_PASSWORD}
- MYSQL_ROOT_PASSWORD=${RootPW}
- MYSQL_MAX_ALLOWED_PACKET=128M
- MYSQL_INNODB_LOG_FILE_SIZE=64M
- ImageName = owncloud.mariadb
- MARIADB_AUTO_UPGRADE=1
networks:
net:
ipv4_address: 172.16.0.9
networks:
net:
external:
name: apache_net
Problem No 1:
The entries for the proxy relay (see section ‘#Relay Proxy’) do not appear in config.php. What could be the reason for this?
Problem No 2:
I map a directory of the host to be able to check the config.php after creating the container (see “volumes” of server). When I set this up and create the container, everything works at fine. But after a “docker compose down” and “docker compose up -d” the owncloud container crashes with the following error message:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_appconfig' doesn't exist in /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:53
Stack trace:
#0 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(128): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PD
OException))
#1 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(855): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctr
That’s why I have to delete the images afterwards and reinstall them. Without an ‘volumes’ entry it works fine. What can I do to avoid this?
Many thanks for any help
Stefan