I installed Nextcloud with the official Docker container which includes Apache. I want to permanently access the settings (apache2.conf file).
When opening a shell, I saw that the log files are in /var/log and the configuration files in /etc/apache2.
So I added these two lines in docker-compose.yml:
- ./ncloud-logs/:/var/log
- ./ncloud-conf/:/etc/apache2
The first one works without problem: the logs are accessible.
However, the second line causes an error that prevents the container from starting:
apache2: Could not open configuration file /etc/apache2/apache2.conf: No such file or directory
Below, the complete docker-compose.yml file
Thanks for your help
version: "3.8"
services:
ncloud-db:
image: mysql
container_name: ncloud-db
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=[password]
- MYSQL_DATABASE=ncloud
- MYSQL_USER=[username]
- MYSQL_PASSWORD=[password]
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
volumes:
- ./dbdata:/var/lib/mysql
ncloud-app:
image: nextcloud
container_name: ncloud-app
hostname: ncloud-app
restart: unless-stopped
environment:
- MYSQL_HOST=ncloud-db
- MYSQL_DATABASE=ncloud
- MYSQL_USER=[username]
- MYSQL_PASSWORD=[password]
- NEXTCLOUD_ADMIN_USER=[username]
- NEXTCLOUD_ADMIN_PASSWORD=[password]
ports:
- "8089:80"
links:
- ncloud-db
volumes:
- ./ncloud-data/:/var/www/html
- ./ncloud-logs/:/var/log
#problem!! - ./ncloud-conf/:/etc/apache2
ncloud-pma:
image: phpmyadmin
container_name: ncloud-pma
environment:
# https://docs.phpmyadmin.net/en/latest/setup.html#docker-environment-variables
- PMA_HOST=ncloud-db
- PMA_PORT=3306
- PMA_ARBITRARY=1
- UPLOAD_LIMIT=1024M
ports:
- "8083:80"
links:
- ncloud-db