I'm in search to create an extra addons on my odoo. I've created an addon, and I've set in my docker compose file to mount the folder containing my addon on a folder into my odoo docker image defining to read also this folder when odoo container starts. The problem is that I don't see my extra addons into the addons list when I'm using odoo via browser.
I'm using odoo 12 docker image in docker compose
Inside addons/ i have my extra addons and inside config/ i have my odoo.conf
docker-compose.yml
version: '2'
services:
  web:
    image: odoo:12.0
    depends_on:
      - db
    ports:
      - "8069:8069"
    volumes:
      - odoo-web-data:/var/lib/odoo
      - ./config:/etc/odoo
      - ./addons:/mnt/extra-addons
  db:
    image: postgres:10
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_PASSWORD=odoo
      - POSTGRES_USER=odoo
      - PGDATA=/var/lib/postgresql/data/pgdata
    volumes:
      - odoo-db-data:/var/lib/postgresql/data/pgdata
volumes:
  odoo-web-data:
  odoo-db-data:
odoo.conf
[options]
addons_path = /mnt/extra-addons
data_dir = /var/lib/odoo
If I display the content of addons I see:
$ ls addons/
custom-addon
custom-addon contains:
$ ls custom-addon/
controllers  demo  __init__.py  __manifest__.py  models  security  views
In a odoo log I read that /mnt/extra-addons was read by odoo:
web_1  | 2019-08-02 13:45:12,691 1 INFO ? odoo: addons paths: ['/var/lib/odoo/addons/12.0', '/mnt/extra-addons', '/usr/lib/python3/dist-packages/odoo/addons'] 
If I access into container and i list the content of /mnt/extra-addons  I can see the content of my local addons folder mounted into container.
$ docker-compose run web bin/bash
odoo@1cb225a60e13:/$ ls mnt/extra-addons/
custom-addon
But I can't see my addons listed into the modules list on odoo