Reputation: 15
I'm new to this and I do not know if I'm doing the right steps. The first thing I did was create a folder / addons, then inside this folder I created another folder / addons / celes_app, and within this last folder I have all my files (init.py, manifest.py, etc). Then I create the following containers:
docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name db postgres:10
docker run -v /addons:/mnt/extra-addons -p 8069:8069 --name odoo --link db:db -t odoo
By doing so, the container is successfully created. I open a browser and enter port 8069, it asks me to create a new database, and when I create it I get the following error:
2018-11-28 23:45:46,936 1 INFO None odoo.service.db: Create database Prueba.
2018-11-28 23:45:47,402 1 ERROR None odoo.service.db: CREATE DATABASE
failed: Traceback (most recent call last): File "/usr/lib/python3/dist-
packages/odoo/service/db.py", line 58, in _initialize_db odoo.modules.db.initialize(cr)
File "/usr/lib/python3/dist-packages/odoo/modules/db.py", line 34, in initialize for i in odoo.modules.get_modules():
File "/usr/lib/python3/dist-packages/odoo/modules/module.py", line 408, in get_modules plist.extend(listdir(ad))
File "/usr/lib/python3/dist-packages/odoo/modules/module.py", line 401, in listdir for it in os.listdir(dir)
PermissionError: [Errno 13] Permission denied: '/mnt/extra-addons' 2018-11-28 23:45:47,
422 1 ERROR None odoo.modules.loading: Database Prueba not initialized, you can force it with -i base 2018-11-28 23:45:47,
485 1 INFO Prueba odoo.sql_db: ConnectionPool(used=0/count=0/max=64): Closed 1 connections to 'dbname=Prueba user=odoo password=xxxx host=172.17.0.2 port=5432 sslmode=prefer'
Thank you
Upvotes: 1
Views: 3769
Reputation: 393
Follow these steps & I hope this solution works for you-
Firstly mount your local folder which contains my extra-addons by the command-
$ docker run -v /path/to/your/local/folder:/mnt/extra-addons -p 8069:8069 --name odoo --link db:db -t odoo
Then check weather your local folder is mounted on the Odoo container or not by-
$ docker exec -u root -it odoo /bin/bash
Now you are logged in, (after logging)
$ cd /mnt/extra-addons
$ ls
You should see your files which were present in your local/folder. Now, its done just restart your docker odoo server
To stop-
$ sudo docker stop db
$ sudo docker stop odoo
$ sudo service docker stop
To Start-
$ sudo service docker start
$ sudo docker start db
$ sudo docker start -a odoo
Now you can install your modules from the app and the database should also work fine.
Upvotes: 2