Script de déploiement de odoo dans un docker
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. FROM python:3.9-slim-buster
  2. MAINTAINER CLI <https://cli.coop>
  3. ENV APT_DEPS='build-essential libldap2-dev libpq-dev libsasl2-dev' \
  4. LANG=C.UTF-8 \
  5. LC_ALL=C.UTF-8 \
  6. PGDATABASE=odoo
  7. RUN set -x; \
  8. apt-get update &&\
  9. apt-get install -y --no-install-recommends \
  10. curl \
  11. git \
  12. gnupg \
  13. npm \
  14. openssh-client &&\
  15. echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' >> /etc/apt/sources.list.d/postgresql.list &&\
  16. curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - &&\
  17. curl -o wkhtmltox.deb -SL https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_arm64.deb &&\
  18. echo '43d0db99ab0e6b5f60b465a49c764c50d6b31337 wkhtmltox.deb' | sha1sum -c - &&\
  19. apt-get update &&\
  20. apt-get install -y --no-install-recommends ./wkhtmltox.deb &&\
  21. apt-get install -y --no-install-recommends postgresql-client &&\
  22. apt-get install -y --no-install-recommends ${APT_DEPS} &&\
  23. pip3 install -r https://raw.githubusercontent.com/OCA/OCB/14.0/requirements.txt &&\
  24. pip3 install phonenumbers simplejson gevent==20.12.1 PyYAML zxcvbn &&\
  25. apt-get -y purge ${APT_DEPS} &&\
  26. apt-get -y autoremove &&\
  27. rm -rf /var/lib/apt/lists/* wkhtmltox.deb
  28. # Add Git Known Hosts
  29. #COPY ./ssh_known_git_hosts /root/.ssh/known_hosts
  30. # Install Odoo and remove not French translations and .git directory to limit amount of data used by container
  31. RUN set -x; \
  32. useradd -l --create-home --home-dir /opt/odoo --no-log-init odoo &&\
  33. /bin/bash -c "mkdir -p /opt/odoo/{etc,odoo,additional_addons,private_addons,data,private}" &&\
  34. git clone -b 14.0 --depth 1 https://github.com/OCA/OCB.git /opt/odoo/odoo &&\
  35. rm -rf /opt/odoo/odoo/.git &&\
  36. chown -R odoo:odoo /opt/odoo
  37. # Install Odoo OCA default dependencies
  38. RUN set -x; \
  39. mkdir -p /tmp/oca-repos/ &&\
  40. git clone -b 14.0 --depth 1 https://github.com/OCA/account-financial-reporting.git /tmp/oca-repos/account-financial-reporting &&\
  41. mv /tmp/oca-repos/account-financial-reporting/account_tax_balance /opt/odoo/additional_addons/ &&\
  42. git clone -b 14.0 --depth 1 https://github.com/OCA/account-financial-tools.git /tmp/oca-repos/account-financial-tools &&\
  43. mv /tmp/oca-repos/account-financial-tools/account_lock_date_update \
  44. /opt/odoo/additional_addons/ &&\
  45. mv /tmp/oca-repos/account-financial-tools/account_menu /opt/odoo/additional_addons/ &&\
  46. # Comment out modules not yet migrated on OCA for v14
  47. #git clone -b 14.0 --depth 1 https://github.com/OCA/account-invoicing.git /tmp/oca-repos/account-invoicing &&\
  48. #mv /tmp/oca-repos/account-invoicing/sale_timesheet_invoice_description \
  49. # /opt/odoo/additional_addons/ &&\
  50. git clone -b 14.0 --depth 1 https://github.com/OCA/bank-statement-import.git /tmp/oca-repos/bank-statement-import &&\
  51. mv /tmp/oca-repos/bank-statement-import/account_statement_import \
  52. /tmp/oca-repos/bank-statement-import/account_statement_import_ofx \
  53. /opt/odoo/additional_addons/ &&\
  54. git clone -b 14.0 --depth 1 https://github.com/OCA/partner-contact.git /tmp/oca-repos/partner-contact &&\
  55. mv /tmp/oca-repos/partner-contact/partner_disable_gravatar \
  56. /tmp/oca-repos/partner-contact/partner_firstname \
  57. /opt/odoo/additional_addons/ &&\
  58. git clone -b 14.0 --depth 1 https://github.com/OCA/project.git /tmp/oca-repos/project &&\
  59. mv /tmp/oca-repos/project/project_category \
  60. /tmp/oca-repos/project/project_status \
  61. /tmp/oca-repos/project/project_task_default_stage \
  62. /tmp/oca-repos/project/project_template \
  63. /tmp/oca-repos/project/project_timeline \
  64. /opt/odoo/additional_addons/ &&\
  65. git clone -b 14.0 --depth 1 https://github.com/OCA/server-auth.git /tmp/oca-repos/server-auth &&\
  66. mv /tmp/oca-repos/server-auth/password_security \
  67. /opt/odoo/additional_addons/ &&\
  68. git clone -b 14.0 --depth 1 https://github.com/OCA/server-brand.git /tmp/oca-repos/server-brand &&\
  69. mv /tmp/oca-repos/server-brand/disable_odoo_online \
  70. /tmp/oca-repos/server-brand/remove_odoo_enterprise \
  71. /opt/odoo/additional_addons/ &&\
  72. git clone -b 14.0 --depth 1 https://github.com/OCA/server-tools.git /tmp/oca-repos/server-tools &&\
  73. mv /tmp/oca-repos/server-tools/base_search_fuzzy \
  74. /opt/odoo/additional_addons/ &&\
  75. git clone -b 14.0 --depth 1 https://github.com/OCA/server-ux.git /tmp/oca-repos/server-ux &&\
  76. mv /tmp/oca-repos/server-ux/base_technical_features \
  77. /tmp/oca-repos/server-ux/date_range \
  78. /tmp/oca-repos/server-ux/mass_editing \
  79. /opt/odoo/additional_addons/ &&\
  80. git clone -b 14.0 --depth 1 https://github.com/OCA/social.git /tmp/oca-repos/social &&\
  81. mv /tmp/oca-repos/social/base_search_mail_content \
  82. /tmp/oca-repos/social/mail_debrand \
  83. /opt/odoo/additional_addons/ &&\
  84. git clone -b 14.0 --depth 1 https://github.com/OCA/web.git /tmp/oca-repos/web &&\
  85. mv /tmp/oca-repos/web/web_environment_ribbon \
  86. /tmp/oca-repos/web/web_responsive \
  87. /tmp/oca-repos/web/web_timeline \
  88. /opt/odoo/additional_addons/ &&\
  89. rm -rf /tmp/oca-repos/ &&\
  90. find /opt/odoo/additional_addons/*/i18n/ -type f -not -name 'fr.po' -delete &&\
  91. chown -R odoo:odoo /opt/odoo
  92. # Copy entrypoint script and Odoo configuration file & create log file
  93. COPY ./entrypoint.sh /
  94. COPY ./odoo.conf /opt/odoo/etc/odoo.conf
  95. RUN chown odoo:odoo /opt/odoo/etc/odoo.conf
  96. RUN touch /var/log/odoo-exec.log && chown odoo:odoo /var/log/odoo-exec.log
  97. # Mount /opt/odoo/data to allow restoring filestore
  98. VOLUME ["/opt/odoo/data/"]
  99. # Expose Odoo services
  100. EXPOSE 8069
  101. COPY wait-for-psql.py /usr/local/bin/wait-for-psql.py
  102. # Set default user when running the container
  103. USER odoo
  104. # Start
  105. ENTRYPOINT ["/entrypoint.sh"]
  106. CMD ["/opt/odoo/odoo/odoo-bin" "-c /opt/odoo/etc/odoo.conf"]
  107. # Metadata
  108. #LABEL org.label-schema.schema-version="14.0" \
  109. # org.label-schema.vendor=LeFilament \
  110. # org.label-schema.license=Apache-2.0 \
  111. # org.label-schema.vcs-url="https://sources.le-filament.com/lefilament/odoo_docker"