I am deploying Odoo 15 with Docker, and I am using the docker-compose.yml
recommended in https://hub.docker.com/_/odoo. As you can see, the following volumes are created for the web service:
volumes:
- odoo-web-data:/var/lib/odoo
- ./config:/etc/odoo
- ./addons:/mnt/extra-addons
The conclusion here is that there is a volume named odoo-web-data
for the Odoo core, and two binds, which I guess they are in order to modify easily the configuration file and the extra addons.
If I expect to add a lot of modules in the local directory addons
, in order to add those modules to the container directory extra-addons
, and therefore adding them to the Odoo running in the container, does it make sense to add them this way?
For example, I am going to add the whole Odoo Community Association l10n-spain
repository from GitHub (with all their addons), among others. Obviously I will do git pull
every now and again to update the repository.
As I am not an expert on Docker, do you think this structure is the best? What if I need to update the Odoo core in the named volume?
CodePudding user response:
There shouldn't be the core in volume odoo-web-data, only the filestore and sessions. The core itself is already installed in the docker image as you can see here
# Install Odoo
ENV ODOO_VERSION 15.0
ARG ODOO_RELEASE=20220718
ARG ODOO_SHA=dc4a5b8c5be8f873e751539117f5aa41d9f7b217
RUN curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \
&& echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \
&& apt-get update \
&& apt-get -y install --no-install-recommends ./odoo.deb \
&& rm -rf /var/lib/apt/lists/* odoo.deb
So updating the core usually means: Build or pull the image (for example latest) and recreate the container(s). And sometimes you also have to make an update for all modules for your existing databases, because the core (code) has changed.
CodePudding user response:
The DigitalOcean's guide explains in details how to deploy odoo with docker using nginx (on Ubuntu 20.04):
Step 1 — Installing Docker Compose
Step 2 — Running Odoo and PostgreSQL with Docker Compose
Step 3 — Installing and Configuring Nginx
Step 4 — Installing Certbot and Setting Up TLS Certificates
Step 5 — Setting Up Odoo
Full documentation here : https://www.digitalocean.com/community/tutorials/how-to-install-odoo-on-ubuntu-20-04-with-docker