129 lines
3.3 KiB
Docker
Executable File
129 lines
3.3 KiB
Docker
Executable File
FROM node as builder-node
|
|
|
|
ARG TRYTOND_VERSION
|
|
ENV SERIES ${TRYTOND_VERSION}
|
|
|
|
RUN npm install -g bower
|
|
RUN curl https://downloads.tryton.org/${SERIES}/tryton-sao-last.tgz | tar zxf - -C /
|
|
RUN cd /package && bower install --allow-root
|
|
|
|
FROM debian:11-slim
|
|
|
|
ARG SERIES
|
|
ARG PYTHON_VERSION
|
|
ARG TRYTOND_VERSION
|
|
ARG Provider
|
|
ARG DIR_MODULES
|
|
ARG TRYTOND_LOGGING_CONFIG
|
|
ARG TRYTOND_LOGGING_LEVEL
|
|
ARG DEVELOP
|
|
ARG WORKER
|
|
ARG EMAIL
|
|
ARG TRYTONPASSFILE
|
|
ARG SMTP
|
|
ARG SMTP_TYPE
|
|
ARG SMTP_USER
|
|
ARG SMTP_PASSWORD
|
|
ARG SMTP_DOMAIN
|
|
ARG SMTP_PORT
|
|
ARG SMTP_FROM
|
|
ARG SMTP_EMAIL
|
|
|
|
ENV SERIES ${TRYTOND_VERSION}
|
|
|
|
LABEL maintainer="Tryton <foundation@tryton.org>" \
|
|
org.label-schema.name="Tryton" \
|
|
org.label-schema.url="http://www.tryton.org/" \
|
|
org.label-schema.vendor="Tryton" \
|
|
org.label-schema.version="$SERIES" \
|
|
org.label-schema.schema-version="1.0"
|
|
|
|
ENV LANG C.UTF-8
|
|
|
|
RUN groupadd -r trytond \
|
|
&& useradd --no-log-init -r -d /var/lib/trytond -m -g trytond trytond \
|
|
&& mkdir /var/lib/trytond/db && chown trytond:trytond /var/lib/trytond/db \
|
|
&& mkdir /var/lib/trytond/www \
|
|
&& mkdir -p /etc/python3 \
|
|
&& echo "[DEFAULT]\nbyte-compile = standard, optimize" \
|
|
> /etc/python3/debian_config
|
|
|
|
USER root
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
git \
|
|
python3-click \
|
|
python3-ipython \
|
|
curl \
|
|
python3 \
|
|
python3-pip \
|
|
python3-setuptools \
|
|
python3-wheel \
|
|
uwsgi \
|
|
uwsgi-plugin-python3 \
|
|
python3-argcomplete \
|
|
# trytond
|
|
python3-bcrypt \
|
|
python3-cffi \
|
|
python3-genshi \
|
|
python3-gevent \
|
|
python3-html2text \
|
|
python3-pil \
|
|
python3-levenshtein \
|
|
python3-lxml \
|
|
python3-passlib \
|
|
python3-polib \
|
|
python3-psycopg2 \
|
|
python3-pydot \
|
|
python3-werkzeug \
|
|
python3-wrapt \
|
|
# modules
|
|
python3-dateutil \
|
|
python3-ldap3 \
|
|
python3-magic \
|
|
python3-ofxparse \
|
|
python3-pypdf2 \
|
|
python3-pysimplesoap \
|
|
python3-requests \
|
|
python3-simpleeval \
|
|
python3-tz \
|
|
python3-yaml \
|
|
python3-zeep \
|
|
weasyprint \
|
|
libpango-1.0-0 \
|
|
libpangoft2-1.0-0 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN pip3 install --no-cache-dir \
|
|
"trytond == ${SERIES}.*" \
|
|
"proteus == ${SERIES}.*" \
|
|
&& for module in `curl https://downloads-cdn.tryton.org/${SERIES}/modules.txt`; do \
|
|
pip3 install --no-cache-dir "trytond_${module} == ${SERIES}.*" || exit 1; \
|
|
done \
|
|
&& pip3 install --no-cache-dir \
|
|
phonenumbers \
|
|
pycountry \
|
|
pygal \
|
|
python-stdnum[SOAP] \
|
|
schwifty \
|
|
&& python3 -c "import compileall; compileall.compile_path(maxlevels=10, optimize=1)"
|
|
|
|
COPY --from=builder-node /package /var/lib/trytond/www
|
|
COPY entrypoint.sh /
|
|
COPY trytond.conf /etc/trytond.conf
|
|
COPY uwsgi.conf /etc/uwsgi.conf
|
|
|
|
COPY trytond_logging.conf /etc/trytond_logging.conf
|
|
COPY trytond_cron_logging.conf /etc/trytond_cron_logging.conf
|
|
COPY trytond_worker_logging.conf /etc/trytond_worker_logging.conf
|
|
|
|
EXPOSE 8000
|
|
|
|
VOLUME ["/var/lib/trytond/db"]
|
|
ENV TRYTOND_CONFIG=/etc/trytond.conf
|
|
|
|
USER trytond
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
CMD ["uwsgi", "--ini", "/etc/uwsgi.conf"] |