Why Deploy Odoo as a Docker Container? 5808 Views Oct 28, 2020
Solomon Hykes founded Docker in 2013 with an aim to make containers easy to use. With the introduction of Docker 1.0 in June 2014, the buzz has only become louder.
According to Docker, more than 3.5 million applications have been placed in containers using Docker technology, and over 37 billion containerized applications have been downloaded.
Now let’s read and try to understand what Docker is all about in detail and its relationship with Odoo.
What is Docker?
Docker is a program that allows you to build containers that wrap software installations into a full file system that includes all you need to run the software: code, runtime executables, configuration files, system libraries. All these specifications are usually installed on a server to allow the software to run smoothly.
Containers are a standardized software unit that allows developers to isolate their apps from their environment so that they work on every machine regardless of the platform. For software developers today, Docker is the de facto standard for creating and sharing containerized apps from desktop to cloud. It creates an exclusive, code-to-cloud experience for developers and their teams.
Since Odoo installations have many dependencies and configuration specifications, Docker is one way to make Odoo installations much more portable and easier to manage.
Setting up Docker with Odoo
Docker has a bunch of useful documentation and it’s pretty easy to set up. These documentations tell you how you can use Docker with Odoo to get the installation up and running. From there, you learn how to do tasks like starting and stopping the Odoo server. If you are interested in learning how to build modular Odoo installations that can be easily transferred between servers or if you want to host several Odoo installations on the same server, Docker can make this much simpler once you understand the basics.
Deploying Odoo as a Docker Container
If you want to test ODOO you can either install the full system on a Linux server, or you could use it as a container for faster setup and deployment. This is a perfect way to get the wheels of the system up and running before taking the time to deploy them in a conventional way.
In this article, we’ll take the example of deploying Odoo as a Docker container on Ubuntu 18.04.
Get your Ubuntu server installed and running and Docker working properly. You will also need to have a user account created in order to issue commands.
After your Ubuntu setup is complete, you need to deploy a PostgreSQL container. Log in to your Ubuntu Server instance and issue the following command:
docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres –name db postgres:10
If this order is completed, you will have a running PostgreSQL instance ready for the ODOO deployment.
This is where we deploy the ODOO container. We can deploy on the internal and external ports 8069. Here, the port needs to be opened on your network for this to function properly. To deploy the ODOO container, issue the following command:
docker run -p 8069:8069 –name odoo –link db:db -t odoo
This deployment uses generic configuration. You can use your own custom setup with the aid of volumes if you want to make adjustments to that. This requires writing your custom configuration manually or copying one from another deployment that you used.
The ODOO configuration file can be found in / etc / odoo / odoo.conf. To use these volumes, you need to place the file in a directory that can be read by your Docker user. To deploy ODOO, using your custom configuration file, issue the command:
docker run -v /data/odoo.conf:/etc/odoo -p 8069:8069 –name odoo –link db:db -t odoo
Once the command is issued, open the browser and point it to http:/SERVER IP:8069, where SERVER IP is the IP address of your docker server. You will be welcomed by the ODOO set-up screen.
Your Odoo ERP is set and ready to use.
Developing apps today need so much more than just writing code. Multiple languages, systems, architectures, and inter-tool interfaces for each life-cycle stage build immense complexity. Docker simplifies and accelerates the workflow while at the same time allowing developers the ability to experiment with their choice of tools, framework stacks, and deployment environments for each project. Contact Brainvire if you are looking for Odoo ERP Development Services.
Everything You Need to Know About Klevu for Unparalleled Growth and Better User Experience
Why Companies Turn To Digital Marketing To Survive COVID-19
9 Ways to Engage Your Website Users
10 Reasons Why Marketing in Social Media is Essential for Business Owners
8 Ultimate Instagram Marketing Tips That Can Never Go Wrong
The CEO of Brainvire InfoTech Mr. Chintan Shah Shares Significant Business Strategies with GoodFirms