This project configures a Docker environment to host an extremely lightweight Ubuntu instance ready for hosting Odoo.
This image DOES NOT CONTAIN THE ODOO SOURCE. Please see the Docker Volumes for Odoo section.
We start from the latest Ubuntu LTS core and add a few administrative tools.
We also install NodeJS and NPM, plus less.js and rtlcss.
The following is not installed on the image:
- apache/nginx
- odoo
- postgresql
There are two fundamental considerations to containerizing Odoo.
- The source code is quite large.
- The Odoo data-dir needs to be persistent, yet accessible by many running containers.
One way to handle this is to just bind mount a directory holding the Odoo source on the Docker host to every container. That didn't seem very containerized. If you plan to use an NFS mount or some other method of managing the Odoo filestore, then you should proceed as you intend and ignore this next section.
The Dockerfile creates two Volumes - one at /srv/odoo and one at /srv/odoo-filestore.
The -v options on the command docker run -v named_volume:/path/on/container
in the installation guide results in two named volumes being created, one named odoo and the other odoo-filestore. This provides an easy way for multiple Docker Containers running Odoo on the same Docker Engine to share the same filestore. It also dramatically reduces the size of the Docker image responsible for running the source.
The installation guide provides a crude way of loading the Odoo source code onto the 'odoo' named Docker volume. You'll need to have an accessible instance of Postgres to use as your database to run that source.
You could ultimately benefit from using an Odoo configuration file and setting 'odoo-bin' to run as your ENTRYPOINT when the container starts. That suggestion is just one solution for turning a containerized version of the Odoo source into a service. This image is meant to be just a starting point for many options.
One example of how to securely store credentials and start Odoo can be found here.
These instructions will get you a copy of the image up and running on your local machine for development and testing purposes.
Ensure you have the latest version of Docker installed on your machine. If not, follow the official guidelines for installation from Docker's website.
There are two ways to get the image. Building it yourself from the Dockerfile is recommended.
- Clone this repository:
git clone https://github.com/gadgetjoejoe/odoo-on-ubuntu.git
- Navigate to the project directory:
cd odoo-on-ubuntu
- Build the Docker image:
docker build --tag odoo-on-ubuntu .
- Start the Docker container:
docker run --name odoo-container -it odoo-on-ubuntu
You can also pull the image directly from the GitHub Package Registry.
After pulling the image, start the Docker container: docker run --name odoo-container -it odoo-on-ubuntu
One simple way to install Odoo onto your volume is to use git. Confirm you're in /srv/odoo then run: git clone https://github.com/odoo/odoo.git .
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
Joe Clark - [email protected]
Project Link: https://github.com/gadgetjoejoe/odoo-on-ubuntu
Happy coding!