<commit_before>FROM python:2-alpine
MAINTAINER Tecnativa <<EMAIL>>

# Enable Odoo user and filestore
RUN adduser -D odoo \
    && mkdir -p /home/odoo/.local/share/Odoo \
    && chown -R odoo:odoo /home/odoo
VOLUME ["/home/odoo/.local/share/Odoo"]
EXPOSE 8069 8072

# Subimage triggers
ONBUILD ARG AGGREGATE=yes
ONBUILD ARG CLEAN=yes
ONBUILD ARG COMPILE=yes
ONBUILD ARG ADMIN_PASSWORD=<PASSWORD>
ONBUILD ARG SMTP_SERVER=smtp
ONBUILD ARG PROXY_MODE=yes
ONBUILD ARG PGUSER=odoo
ONBUILD ARG PGPASSWORD=<PASSWORD>
ONBUILD ARG PGHOST=db
ONBUILD ARG PGDATABASE=odooproduction
ONBUILD ENV PGUSER="$PGUSER" \
            PGPASSWORD="$<PASSWORD>" \
            PGHOST="$PGHOST" \
            PGDATABASE="$PGDATABASE"
ONBUILD ARG LOCAL_CUSTOM_DIR=./custom
ONBUILD COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom
ONBUILD WORKDIR /opt/odoo
ONBUILD RUN chown -R odoo:odoo .
ONBUILD RUN ["/opt/odoo/common/build.sh"]
ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint.sh"]
ONBUILD CMD ["/usr/local/bin/odoo.py"]
ONBUILD USER odoo

ARG PYTHONOPTIMIZE=2
ENV ODOO_RC=/opt/odoo/auto/odoo.conf \
    UNACCENT=yes \
    PYTHONOPTIMIZE="$PYTHONOPTIMIZE" \
    # HACK for Pillow: https://github.com/Tecnativa/odoo/pull/1
    CFLAGS="-L/lib" \
    # Git and git-aggregator
    GIT_AUTHOR_NAME=docker-odoo \
    EMAIL=https://hub.docker.com/r/tecnativa/odoo \
    # Postgres
    WAIT_DB=yes \
    # WDB debugger
    WDB_NO_BROWSER_AUTO_OPEN=True \
    WDB_SOCKET_SERVER=wdb \
    WDB_WEB_PORT=1984 \
    WDB_WEB_SERVER=localhost

# Other requirements and recommendations to run Odoo
# See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control
RUN apk add --no-cache \
        ghostscript icu libev nodejs openssl \
        postgresql-libs poppler-utils ruby
# Special case for wkhtmltox
# HACK https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3265
# Idea from https://hub.docker.com/r/loicmahieu/alpine-wkhtmltopdf/
# Use prepackaged wkhtmltopdf and wrap it with a dummy X server
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

# Patched git-aggregator<commit_msg>:bug: Fix wrong usage of CFLAGS.<commit_after>FROM python:2-alpine
MAINTAINER Tecnativa <<EMAIL>>

# Enable Odoo user and filestore
RUN adduser -D odoo \
    && mkdir -p /home/odoo/.local/share/Odoo \
    && chown -R odoo:odoo /home/odoo
VOLUME ["/home/odoo/.local/share/Odoo"]
EXPOSE 8069 8072

# Subimage triggers
ONBUILD ARG AGGREGATE=yes
ONBUILD ARG CLEAN=yes
ONBUILD ARG COMPILE=yes
ONBUILD ARG ADMIN_PASSWORD=<PASSWORD>
ONBUILD ARG SMTP_SERVER=smtp
ONBUILD ARG PROXY_MODE=yes
ONBUILD ARG PGUSER=odoo
ONBUILD ARG PGPASSWORD=<PASSWORD>
ONBUILD ARG PGHOST=db
ONBUILD ARG PGDATABASE=odooproduction
ONBUILD ENV PGUSER="$PGUSER" \
            PGPASSWORD="$PGPASSWORD" \
            PGHOST="$PGHOST" \
            PGDATABASE="$PGDATABASE"
ONBUILD ARG LOCAL_CUSTOM_DIR=./custom
ONBUILD COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom
ONBUILD WORKDIR /opt/odoo
ONBUILD RUN chown -R odoo:odoo .
ONBUILD RUN ["/opt/odoo/common/build.sh"]
ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint.sh"]
ONBUILD CMD ["/usr/local/bin/odoo.py"]
ONBUILD USER odoo

ARG PYTHONOPTIMIZE=2
ENV ODOO_RC=/opt/odoo/auto/odoo.conf \
    UNACCENT=yes \
    PYTHONOPTIMIZE="$PYTHONOPTIMIZE" \
    # HACK for Pillow: https://github.com/Tecnativa/odoo/pull/1
    LDFLAGS="-L/lib" \
    # Git and git-aggregator
    GIT_AUTHOR_NAME=docker-odoo \
    EMAIL=https://hub.docker.com/r/tecnativa/odoo \
    # Postgres
    WAIT_DB=yes \
    # WDB debugger
    WDB_NO_BROWSER_AUTO_OPEN=True \
    WDB_SOCKET_SERVER=wdb \
    WDB_WEB_PORT=1984 \
    WDB_WEB_SERVER=localhost

# Other requirements and recommendations to run Odoo
# See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control
RUN apk add --no-cache \
        ghostscript icu libev nodejs openssl \
        postgresql-libs poppler-utils ruby
# Special case for wkhtmltox
# HACK https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3265
# Idea from https://hub.docker.com/r/loicmahieu/alpine-wkhtmltopdf/
# Use prepackaged wkhtmltopdf and wrap it with a dummy X server
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

# Patched git-aggregator
{'fraction_non_alphanumeric': 0.10831509846827134, 'fraction_numerical': 0.008315098468271335, 'mean_word_length': 3.7466251298027, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '553777', 'n_tokens_mistral': 1871, 'n_tokens_neox': 1773, 'n_words': 366}