Clean Nextcloud 19 apache docker image

I followed the script from the examples on github:

version: ‘3’

services:
db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=
env_file:
- db.env

app:
image: nextcloud:apache
restart: always
ports:
- 8080:80
volumes:
- nextcloud:/var/www/html
environment:
- MYSQL_HOST=db
env_file:
- db.env
depends_on:
- db

volumes:
db:
nextcloud:

And I get the following error message:
Cannot write into “config” directory! This can usually be fixed by giving the webserver write access to the config directory… Or, if you prefer to keep config.php file read only, set the option “config_is_read_only” to true in it. See https://docs.nextcloud.com/server/19/go.php?to=admin-config

Does anyone have an idea?

it look like a docker-compose file, then it could be that you wrongly mount the volume. it is

      /local/paht/on/a/host/machine:/path/in/docker

you also have to make sure that docker user can write to the folder /local/paht/on/a/host/machine

Check this out: