Contributors mailing list archives

contributors@odoo-community.org

Re: Recommended Contributor Tooling (RCT)

by
XCG Consulting, Florent Aide
- 21/10/2015 10:47:58
Hi

2015-10-21 11:23 GMT+02:00 Levent Karakas <levent@mektup.at>:
> I have few comments from our dockerizing experience in the production
> environment, that may contribute to this discussion:
>
> 1) We always use external database out of docker environment in production.
> More specifically we use Amazon RDS but even if it was managed by ourselves,
> we wouldn't use -link unless we use one database per docker. Db container
> restart/update messes up all containers that are linked to it and requires
> restart of all containers.  Yes this is a huge discussion since it has
> advantages and disadvantages, but i want you to know how we ended up.

We also favor "real" ips and adressing instead or --link for the same reasons

> 3) For downloading latest source/syncing fastest and safest option for us
> was to download zip archive. You might want to consider this since this
> saves space since you don't need git. It works like this:
>
>  ENV ODOO_VERSION 8.0
>
>  curl -o odoo.zip -SL
> https://github.com/oca/odoo/archive/${ODOO_VERSION}.zip \
> && unzip -q odoo.zip -d /tmp \
> && mv /tmp/odoo-${ODOO_VERSION} /opt/odoo/server \
> && rm -rf odoo.zip

same here to avoid cloning the whole history

> 4) If you happen to launch a source in docker, python compiles .py files and
> starts creating .pyc files which increases docker instances' differential
> file system.  We get over this problem by compiling all sources during image
> creation.
>
> python -m compileall /opt/odoo/server

nice one!

> 5) We cleaned up the image to get smaller once the image is ready
>
> apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
> -o APT::AutoRemove::SuggestsImportant=false npm gcc \
>         && apt-get -y autoclean \
>         && rm -rf /var/lib/apt/lists/*

you have more cleanups than ours

> 6) removed unnecessary addons which won't be used on the server side:
>        rm -rf /opt/odoo/server/addons/hw_* \

this one we missed, nice catch!

>
> I will be glad if we can use our experience to have something better for the
> community. Our docker is not published but i can share it here, if anyone is
> interested.

I am in the process of setting up a new dockerhub account to work on
merging improvements, would you mind proposing pull requests to the
repository (as soon as it is ready) so that we can then do a PR
somewhere on OCA with the result?


-- 
Cordialement,


  Florent AIDE
  Président directeur général
  59 rue Meslay, 75003 Paris
  Tél: +33 1 83 62 72 87
  Mob : +33 6 59 14 19 76
  http://www.xcg-consulting.fr/