minhng92 / odoo-14-docker-compose

Set up Odoo 14 (released 2020) quickly for development/production using Docker Compose.
90 stars 99 forks source link
docker-compose odoo

Quick install

Installing Odoo 14 with one command.

(Supports multiple Odoo instances on one server)

Install docker and docker-compose yourself, then run:

curl -s https://raw.githubusercontent.com/minhng92/odoo-14-docker-compose/master/run.sh | sudo bash -s odoo-one 10014 20014

to set up first Odoo instance @ localhost:10014 (default master password: minhng.info)

and

curl -s https://raw.githubusercontent.com/minhng92/odoo-14-docker-compose/master/run.sh | sudo bash -s odoo-two 11014 21014

to set up another Odoo instance @ localhost:11014 (default master password: minhng.info)

Some arguments:

If curl is not found, install it:

$ sudo apt-get install curl
# or
$ sudo yum install curl

Usage

Start the container:

docker-compose up
ports:
 - "10014:8069"

Run Odoo container in detached mode (be able to close terminal without stopping Odoo):

docker-compose up -d

If you get the permission issue, change the folder permission to make sure that the container is able to access the directory:

$ git clone https://github.com/minhng92/odoo-14-docker-compose
$ sudo chmod -R 777 addons
$ sudo chmod -R 777 etc
$ mkdir -p postgresql
$ sudo chmod -R 777 postgresql

Increase maximum number of files watching from 8192 (default) to 524288. In order to avoid error when we run multiple Odoo instances. This is an optional step. These commands are for Ubuntu user:

$ if grep -qF "fs.inotify.max_user_watches" /etc/sysctl.conf; then echo $(grep -F "fs.inotify.max_user_watches" /etc/sysctl.conf); else echo "fs.inotify.max_user_watches = 524288" | sudo tee -a /etc/sysctl.conf; fi
$ sudo sysctl -p    # apply new config immediately

Custom addons

The addons/ folder contains custom addons. Just put your custom addons if you have any.

Odoo configuration & log

Odoo container management

Run Odoo:

docker-compose up -d

Restart Odoo:

docker-compose restart

Stop Odoo:

docker-compose down

Live chat

In docker-compose.yml#L21, we exposed port 20014 for live-chat on host.

Configuring nginx to activate live chat feature (in production):

#...
server {
    #...
    location /longpolling/ {
        proxy_pass http://0.0.0.0:20014/longpolling/;
    }
    #...
}
#...

docker-compose.yml

Odoo 14 screenshots

odoo-14-welcome-docker

odoo-14-apps-docker

odoo-14-sales

odoo-14-form