DEV Community


Posted on


Odoo | Hasura GraphQL | Docker

I had been struggling with getting certain Odoo modules working nicely within a Docker container. My interest in Odoo is not for client work, more for infrastructure-as-code and for use as a headless CMS for application development.

However, I wanted to use any API other than Odoo’s XML-RPC.

The initial hope was to get the GraphQL module working. I had issues with graphql-core-server within a Docker container, so gave up, and opted for OpenAPI’s REST instead. I still wasn’t happy.

There is something I dont like about the API being provided by a module and I wanted more separation between the API and Odoo. I was still thinking about GraphQL. Then it hit me. Hasura!

Hasura provides a GraphQL API layer over new or existing Postgres databases. I’ve wanted to have a reason to start playing with it and finally the perfect scenario came along.

Here are the steps to get Odoo running, within a container, alongside Hasura, Postgres and Caddy. Personally, I think this is the greatest thing ever…

Here is the repo —

  1. Install Docker & Docker Compose on host
  2. curl -s | sudo bash -s odoo-hasura-docker

If you want to add modules, copy them into the addons folder. On occasion dependencies need to be installed and examples of how to do so are in the

Odoo.conf in /etc is mounted within the container as well.

Odoo will be running on port 14069, the GraphQL console on 80.

Bon appetit!

Top comments (1)

ajsb85 profile image
Alexander Salas Bastidas

Hi, good starting point.
But what about the scheme?
Do you make it manually with the Hasura Dashboard?

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git