Mattermost/config/config.json: permission denied

For feature requests, please see: Contributing Feature Proposals - Mattermost.

For troubleshooting questions, please post in the following format:

Summary
mattermost/config/config.json: permission denied

Steps to reproduce

docker-compose config

services:
  mattermost:
    container_name: mattermost
    depends_on:
      postgres:
        condition: service_started
    environment:
      MM_SERVICESETTINGS_SITEURL: https://mydomain.com
      MM_SQLSETTINGS_DATASOURCE: postgres://mmuser:thisispassword@postgres:5432/mattermost?sslmode=disable&connect_timeout=10
      MM_SQLSETTINGS_DRIVERNAME: postgres
      TZ: UTC
    image: mattermost/mattermost-team-edition:6.0
    pids_limit: 200
    read_only: false
    restart: unless-stopped
    security_opt:
    - no-new-privileges:true
    tmpfs:
    - /tmp
    volumes:
    - /opt/mattermost/volumes/app/mattermost/config:/mattermost/config:rw
    - /opt/mattermost/volumes/app/mattermost/data:/mattermost/data:rw
    - /opt/mattermost/volumes/app/mattermost/logs:/mattermost/logs:rw
    - /opt/mattermost/volumes/app/mattermost/plugins:/mattermost/plugins:rw
    - /opt/mattermost/volumes/app/mattermost/client/plugins:/mattermost/client/plugins:rw
  postgres:
    container_name: postgres_mattermost
    environment:
      POSTGRES_DB: mattermost
      POSTGRES_PASSWORD: thisispassword
      POSTGRES_USER: mmuser
      TZ: UTC
    image: postgres:13-alpine
    pids_limit: 100
    read_only: true
    restart: unless-stopped
    security_opt:
    - no-new-privileges:true
    tmpfs:
    - /tmp
    - /var/run/postgresql
    volumes:
    - /opt/mattermost/volumes/db/var/lib/postgresql/data:/var/lib/postgresql/data:rw
version: '2.4'

ls -alh .volumes

drwxr-xr-x. 4 mattermost mattermost 27 Oct 13 16:07 .
drwxrwxr-x. 3 mattermost mattermost 59 Oct 14 13:48 ..
drwxr-xr-x. 3 mattermost mattermost 24 Oct 13 16:07 app
drwxr-xr-x. 3 mattermost mattermost 17 Oct 13 16:07 db

pwd

/opt/mattermost/volumes/app/mattermost

ls -alh

drwxr-xr-x. 7       2000       2000 73 Oct 13 16:07 .
drwxr-xr-x. 3 mattermost mattermost 24 Oct 13 16:07 ..
drwxr-xr-x. 3       2000       2000 21 Oct 13 16:07 client
drwxr-xr-x. 2       2000       2000 25 Oct 13 17:01 config
drwxr-xr-x. 3       2000       2000 19 Oct 13 17:01 data
drwxr-xr-x. 2       2000       2000 28 Oct 13 17:01 logs
drwxr-xr-x. 5       2000       2000 67 Oct 13 17:01 plugins

docker-compose up

mattermost    | Error: failed to load configuration: failed to create store: unable to load on store creation: failed to persist: failed to write file: open /mattermost/config/config.json: permission denied
mattermost    | Usage:
mattermost    |   mattermost [flags]
mattermost    |   mattermost [command]
mattermost    |
mattermost    | Available Commands:
mattermost    |   db          Commands related to the database
mattermost    |   export      Export data from Mattermost
mattermost    |   help        Help about any command
mattermost    |   import      Import data.
mattermost    |   jobserver   Start the Mattermost job server
mattermost    |   server      Run the Mattermost server
mattermost    |   version     Display version information
mattermost    |
mattermost    | Flags:
mattermost    |   -c, --config string   Configuration file to use.
mattermost    |   -h, --help            help for mattermost
mattermost    |
mattermost    | Use "mattermost [command] --help" for more information about a command.
mattermost    |
mattermost    | {"timestamp":"2021-10-13 17:01:55.982 Z","level":"info","msg":"Server is initializing...","caller":"app/server.go:265","go_version":"go1.16.7"}

Expected behavior
clear start

Observed behavior
What did you see happen? Please include relevant error messages and/or screenshots.

Was this ever solved?