123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- FROM python:2.7.11-alpine
- # If set only these languages will be included. Format:
- # <language_code> or <language_code>\|<language_code>
- ARG LANGUAGES
- # Install less compiler
- RUN apk add --update nodejs \
- && npm install -g less less-plugin-clean-css \
- && ln -s `which nodejs` /bin/node \
- && ln -s `which lessc` /bin/lessc
- # Install Wk<html>TOpdf
- RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing wkhtmltopdf
- RUN apk add --no-cache xvfb ttf-dejavu ttf-freefont fontconfig dbus
- #COPY bin/wkhtmltox.sh /usr/local/bin/wkhtmltoimage
- #RUN ln /usr/local/bin/wkhtmltoimage /usr/local/bin/wkhtmltopdf
- # Install Odoo and it's dependencies in one go
- ENV ODOO_BRANCH 8.0
- RUN apk add --update tar curl alpine-sdk postgresql-client postgresql postgresql-dev \
- python-dev jpeg jpeg-dev zlib-dev libxml2-dev libxslt libxml2 \
- libxslt-dev openldap-dev libffi-dev linux-headers git \
- && mkdir /opt \
- && cd /opt/ \
- && git clone --branch ${ODOO_BRANCH} --depth 1 --progress https://github.com/odoo/odoo.git \
- && cd odoo/ \
- && if [ "${LANGUAGES}" != "" ]; then \
- find . -regex "^\./.*/i18n/.*\.po$" ! -regex "^\./.*/i18n/\(${LANGUAGES}\)\.po$" -exec rm -f {} \; ; \
- fi \
- && pip install --upgrade pip \
- && CFLAGS="$CFLAGS -L/lib" pip install --no-cache-dir pillow \
- && pip install --no-cache-dir . \
- && pip install --upgrade \
- cryptography \
- inotify \
- watchdog \
- psycogreen \
- psycopg2 \
- gevent \
- pyinotify \
- num2words \
- phonenumbers \
- && adduser -S odoo \
- && chown -R odoo /opt/odoo \
- && cp /usr/bin/pg_dump /tmp \
- && cp /usr/bin/pg_restore /tmp \
- && apk del tar curl alpine-sdk postgresql postgresql-dev python-dev jpeg-dev \
- zlib-dev libxml2-dev libxslt-dev openldap-dev linux-headers git \
- && mv /tmp/pg_dump /usr/bin/pg_dump \
- && mv /tmp/pg_restore /usr/bin/pg_restore
- #RUN if [ ! -f /urs/local/bin/openerp-gevent ]; then \
- # curl -o /usr/local/bin/openerp-gevent -SL https://raw.githubusercontent.com/odoo/odoo/${ODOO_BRANCH}/openerp-gevent \
- # && chmod a+x /usr/local/bin/openerp-gevent \
- # ; fi
- # Create additional Odoo directories
- RUN mkdir -p /var/lib/odoo /etc/odoo /opt/odoo/custom-addons \
- && chown odoo /var/lib/odoo /etc/odoo /opt/odoo/custom-addons
- # Create Odoo configuration
- COPY ./openerp-server.conf /etc/odoo/
- RUN chown odoo /etc/odoo/openerp-server.conf
- ENV OPENERP_SERVER /etc/odoo/openerp-server.conf
- COPY ./entrypoint.sh /
- # Mount
- VOLUME ["/var/lib/odoo", "/opt/odoo/custom-addons"]
- # Expose Odoo services
- EXPOSE 8069 8071
- USER odoo
- ENTRYPOINT ["/entrypoint.sh"]
- CMD ["openerp-server"]
|