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.

73 lines
2.9 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. FROM cloudron/base:3.2.0@sha256:ba1d566164a67c266782545ea9809dc611c4152e27686fd14060332dd88263ea
  2. # Reference: https://github.com/odoo/docker/blob/master/15.0/Dockerfile
  3. RUN mkdir -p /app/code /app/pkg /app/data /app/code/auto/addons
  4. WORKDIR /app/code
  5. RUN apt-get update && \
  6. apt-get install -y \
  7. python3-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev \
  8. libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev libfreetype6-dev \
  9. liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev libpq-dev
  10. RUN curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.focal_amd64.deb && \
  11. echo 'ae4e85641f004a2097621787bf4381e962fb91e1 wkhtmltox.deb' | sha1sum -c - && \
  12. apt-get install -y --no-install-recommends ./wkhtmltox.deb && \
  13. rm -f ./wkhtmltox.deb && \
  14. rm -rf /var/lib/apt/lists/* /var/cache/apt
  15. RUN npm install -g rtlcss
  16. COPY bin/* /usr/local/bin/
  17. COPY lib/doodbalib /usr/local/lib/python3.8/dist-packages/doodbalib
  18. COPY custom /app/code/custom
  19. RUN chmod -R a+rx /usr/local/bin \
  20. && chmod -R a+rX /usr/local/lib/python3.8/dist-packages/doodbalib \
  21. && sync
  22. # Install Odoo
  23. # sync extra addons
  24. ENV ODOO_VERSION=14.0
  25. ENV ODOO_SOURCE=OCA/OCB
  26. ENV DEPTH_DEFAULT=100
  27. ENV DEPTH_MERGE=500
  28. RUN git config --global user.email "$CLOUDRON_MAIL_SMTP_USERNAME"
  29. RUN git config --global user.name "Cloudron service"
  30. # RUN curl -L https://github.com/odoo/odoo/archive/${ODOO_COMMIT_HASH}.tar.gz | tar zx --strip-components 1 -C /app/code && \
  31. RUN git clone https://github.com/odoo/odoo.git --depth 1 -b $ODOO_VERSION /app/code/odoo
  32. WORKDIR /app/code/odoo
  33. RUN git pull -r
  34. WORKDIR /app/code
  35. RUN pip3 install -e /app/code/odoo
  36. RUN pip3 install wheel && \
  37. pip3 install -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt && \
  38. pip3 install psycopg2==2.8.6 \
  39. && pip3 install git-aggregator \
  40. && (python3 -m compileall -q /usr/local/lib/python3.8/ || true)
  41. # Patch Odoo to prevent connecting to the default database named 'postgres' every now and then.
  42. RUN sed -i.bak "720i\ to = tools.config['db_name']" /app/code/odoo/odoo/sql_db.py
  43. # Properly map the LDAP attribute 'displayname' instead of 'cn' to the display name of the logged in user.
  44. RUN sed -i.bak "181s/'cn'/'displayname'/" /app/code/odoo/addons/auth_ldap/models/res_company_ldap.py
  45. RUN rm -rf /var/log/nginx && mkdir /run/nginx && ln -s /run/nginx /var/log/nginx
  46. # Copy entrypoint script and Odoo configuration file
  47. ADD start.sh odoo.conf.sample nginx.conf /app/pkg/
  48. WORKDIR /app/code/custom/src
  49. RUN gitaggregate -c /app/code/custom/src/repos.yaml --expand-env
  50. RUN /app/code/custom/build.d/110-addons-link
  51. RUN /app/code/custom/build.d/200-dependencies
  52. RUN /app/code/custom/build.d/400-clean
  53. RUN /app/code/custom/build.d/900-dependencies-cleanup
  54. RUN mkdir -p /app/data/odoo/filestore /app/data/odoo/addons && \
  55. chown -R cloudron:cloudron /app/data
  56. CMD [ "/app/pkg/start.sh" ]