Skip to content

Latest commit

 

History

History
107 lines (71 loc) · 2.55 KB

File metadata and controls

107 lines (71 loc) · 2.55 KB

Setting up Odoo on docker

This use case illustrate how to deploy odoo when building a webmapping application using microservices architecture based on docker container technology.

Prerequisites

Getting odoo image

Pull the image

docker pull odoo

Create odoo user and grant superuser privileges

Connect to PostgeSQL server

docker exec -it postgis psql -h localhost -U docker -d gis

Add an odoo admin user with odoo password

CREATE USER odoo;

ALTER USER odoo WITH SUPERUSER, CREATEDB, CREATEROLE;

-- Check privileges
\du

-- set odoo password as odoo
\password odoo

Run the image

docker run -p 8069:8069 --name odoo --link postgis:db -t odoo

Run Odoo with a custom configuration

docker run -v /path/to/config:/etc/odoo -p 8069:8069 --name odoo --link postgis:db -t odoo

Mount custom addons

mkdir -p ~/odoo-addons && chmod -R ugo+rwx ~/odoo-addons
docker run -v $HOME/odoo-addons:/mnt/extra-addons -p 8069:8069 --name odoo --link postgis:db -t odoo

with custom odoo password

docker run -v $HOME/odoo-addons:/mnt/extra-addons -p 8069:8069 --name odoo -e POSTGRES_PASSWORD=<pwd> --link postgis:db -t odoo

Point the browser to http://localhost:8069 and setup a new database.

Nginx configuration file sample

server {

        root /var/www/subdomain.domain.my/html;
        index index.html index.htm index.nginx-debian.html;

        server_name subdomain.domain.my;

        proxy_redirect off;

        location / {
            proxy_connect_timeout   3600;
            proxy_read_timeout      3600;
            proxy_send_timeout      3600;
            send_timeout            3600;

            proxy_pass http://127.0.0.1:8069/;
            proxy_pass_header Set-Cookie;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header X-Forwarded-Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

        location /longpolling {

        proxy_pass http://127.0.0.1:8072;
        
        }



        gzip on;
        gzip_min_length 1000;
}

References :