Dockerfile.wip 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # Copyright 2016-TODAY LasLabs Inc.
  2. # License MIT (https://opensource.org/licenses/MIT).
  3. FROM centos:7
  4. MAINTAINER "LasLabs Inc." <support@laslabs.com>
  5. # Enable SystemD
  6. # @TODO: Eval whether needed, move to central setup if so
  7. ENV container docker
  8. RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i ==
  9. systemd-tmpfiles-setup.service ] || rm -f $i; done); \
  10. rm -f /lib/systemd/system/multi-user.target.wants/*;\
  11. rm -f /etc/systemd/system/*.wants/*;\
  12. rm -f /lib/systemd/system/local-fs.target.wants/*; \
  13. rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
  14. rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
  15. rm -f /lib/systemd/system/basic.target.wants/*;\
  16. rm -f /lib/systemd/system/anaconda.target.wants/*;
  17. VOLUME [ "/sys/fs/cgroup" ]
  18. CMD ["/usr/sbin/init"]
  19. # Odoo Binary Dependencies
  20. RUN set -x; \
  21. yum update -y \
  22. && yum install -y epel-release \
  23. && yum install -y \
  24. ca-certificates \
  25. freetype \
  26. fontconfig \
  27. libX11 \
  28. libXext \
  29. libXrender \
  30. nodejs-less \
  31. nodejs-clean-css \
  32. python-inotify \
  33. python-reportlab \
  34. python-reportlab \
  35. wget \
  36. xorg-x11-fonts-75dpi \
  37. xorg-x11-fonts-Type1 \
  38. xorg-x11-server-Xvfb \
  39. zlib
  40. # Wkhtmltox 0.12.3 Headless Using XVFB
  41. RUN cd /usr/local/src \
  42. && wget -o wkhtmltox.tar.xz http://download.gna.org/wkhtmltopdf/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz \
  43. && tar xf wkhtmltox.tar.xz \
  44. && cp wkhtmltox/bin/* /opt \
  45. && rm -Rf wkhtmltox \
  46. && echo -e '#!/bin/bash\nxvfb-run -a --server-args="-screen 0, 1024x768x24" /opt/wkhtmltopdf -q $*' > /usr/bin/wkhtmltopdf \
  47. && echo -e '#!/bin/bash\nxvfb-run -a --server-args="-screen 0, 1024x768x24" /opt/wkhtmltoimage -q $*' > /usr/bin/wkhtmltoimage \
  48. && chmod a+x /usr/bin/{wkhtmltopdf,wkhtmltoimage}
  49. # Install Odoo
  50. ENV ODOO_VERSION 9.0
  51. RUN yum-config-manager --add-repo=https://nightly.odoo.com/${ODOO_VERSION}/nightly/rpm/odoo.repo \
  52. && yum update \
  53. && yum deplist odoo | grep provider | awk '{print $2}' | sort | uniq | grep -v odoo | sed ':a;N;$!ba;s/\n/ /g' | xargs yum -y install
  54. # Copy Entrypoint & Odoo conf
  55. COPY ./entrypoint.sh /
  56. COPY ./openerp-server.conf /etc/odoo/
  57. RUN chown odoo /etc/odoo/openerp-server.conf
  58. # Mount /var/lib/odoo to allow restoring filestore and /mnt/extra-addons for users addons
  59. RUN mkdir -p /mnt/extra-addons \
  60. && chown -R odoo /mnt/extra-addons
  61. VOLUME ["/var/lib/odoo", "/mnt/extra-addons"]
  62. # Expose Odoo services
  63. EXPOSE 8069 8071
  64. # Set the default config file
  65. ENV OPENERP_SERVER /etc/odoo/openerp-server.conf
  66. # Set default user when running the container
  67. USER odoo
  68. ENTRYPOINT ["/entrypoint.sh"]
  69. CMD ["openerp-server"]