Version 3.3.6
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
# vim:set ft=dockerfile:
|
||||
|
||||
####
|
||||
# BASE_IMAGE - Bare bones image with the base packages needed to run Mayan EDMS
|
||||
# base_image - Bare bones image with the base packages needed to run Mayan EDMS
|
||||
####
|
||||
|
||||
FROM debian:9.8-slim as BASE_IMAGE
|
||||
FROM debian:10.0-slim as base_image
|
||||
|
||||
LABEL maintainer="Roberto Rosario roberto.rosario@mayan-edms.com"
|
||||
|
||||
COPY config.env /config.env
|
||||
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
LC_ALL=C.UTF-8 \
|
||||
PROJECT_INSTALL_DIR=/opt/mayan-edms
|
||||
@@ -22,6 +24,7 @@ RUN set -x \
|
||||
&& DEBIAN_FRONTEND=noninteractive \
|
||||
apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
exiftool \
|
||||
fonts-arphic-uming \
|
||||
fonts-arphic-ukai \
|
||||
@@ -31,11 +34,11 @@ apt-get update \
|
||||
graphviz \
|
||||
libfuse2 \
|
||||
libmagic1 \
|
||||
libmariadbclient18 \
|
||||
libmariadb3 \
|
||||
libreoffice \
|
||||
libpq5 \
|
||||
poppler-utils \
|
||||
redis-server \
|
||||
python3-distutils \
|
||||
sane-utils \
|
||||
sudo \
|
||||
supervisor \
|
||||
@@ -54,24 +57,23 @@ apt-get update \
|
||||
&& if [ "$(uname -m)" = "armv7l" ]; then \
|
||||
ln -s /usr/lib/arm-linux-gnueabihf/libz.so /usr/lib/ \
|
||||
&& ln -s /usr/lib/arm-linux-gnueabihf/libjpeg.so /usr/lib/ \
|
||||
; fi \
|
||||
# Discard data when Redis runs out of memory
|
||||
&& echo "maxmemory-policy allkeys-lru" >> /etc/redis/redis.conf \
|
||||
# Disable saving the Redis database
|
||||
echo "save \"\"" >> /etc/redis/redis.conf \
|
||||
# Only provision 1 database
|
||||
&& echo "databases 1" >> /etc/redis/redis.conf
|
||||
; fi
|
||||
|
||||
RUN printf "deb http://httpredir.debian.org/debian stretch-backports main non-free\ndeb-src http://httpredir.debian.org/debian stretch-backports main non-free" > /etc/apt/sources.list.d/backports.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -t stretch-backports -y tesseract-ocr tesseract-ocr-deu
|
||||
|
||||
####
|
||||
# BUILDER_IMAGE - This image buildS the Python package and is discarded afterwards
|
||||
# builder_image - This image builds the Python package and is discarded afterwards
|
||||
# only the build artifact is carried over to the next image.
|
||||
####
|
||||
|
||||
# Reuse image
|
||||
FROM BASE_IMAGE as BUILDER_IMAGE
|
||||
FROM base_image as builder_image
|
||||
|
||||
# Python libraries caching
|
||||
ARG PIP_INDEX_URL
|
||||
ARG PIP_TRUSTED_HOST
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
@@ -101,44 +103,49 @@ apt-get install -y --no-install-recommends \
|
||||
libssl-dev \
|
||||
g++ \
|
||||
gcc \
|
||||
python-dev \
|
||||
python-virtualenv \
|
||||
python3-dev \
|
||||
python3-venv \
|
||||
&& mkdir -p "${PROJECT_INSTALL_DIR}" \
|
||||
&& chown -R mayan:mayan "${PROJECT_INSTALL_DIR}" \
|
||||
&& chown -R mayan:mayan /src
|
||||
|
||||
USER mayan
|
||||
RUN python -m virtualenv "${PROJECT_INSTALL_DIR}" \
|
||||
|
||||
RUN set -a \
|
||||
&& . /config.env \
|
||||
&& set +a \
|
||||
&& python3 -m venv "${PROJECT_INSTALL_DIR}" \
|
||||
&& . "${PROJECT_INSTALL_DIR}/bin/activate" \
|
||||
&& pip install --no-cache-dir --no-use-pep517 \
|
||||
librabbitmq==1.6.1 \
|
||||
mysql-python==1.2.5 \
|
||||
psycopg2==2.7.3.2 \
|
||||
redis==2.10.6 \
|
||||
&& pip install --no-cache-dir \
|
||||
amqp==$PYTHON_AMQP_VERSION \
|
||||
mysqlclient==$PYTHON_MYSQL_VERSION \
|
||||
psycopg2==$PYTHON_PSYCOPG2_VERSION \
|
||||
redis==$PYTHON_REDIS_VERSION \
|
||||
flower==$PYTHON_FLOWER_VERSION \
|
||||
# psutil is needed by ARM builds otherwise gevent and gunicorn fail to start
|
||||
&& UNAME=`uname -m` && if [ "${UNAME#*arm}" != $UNAME ]; then \
|
||||
pip install --no-cache-dir --no-use-pep517 \
|
||||
psutil==5.6.2 \
|
||||
pip install --no-cache-dir \
|
||||
psutil==$PYTHON_PSUTIL_VERSION \
|
||||
; fi \
|
||||
# Install the Python packages needed to build Mayan EDMS
|
||||
&& pip install --no-cache-dir --no-use-pep517 -r /src/requirements/build.txt \
|
||||
&& pip install --no-cache-dir -r /src/requirements/build.txt \
|
||||
# Build Mayan EDMS
|
||||
&& python setup.py sdist \
|
||||
&& python3 setup.py sdist \
|
||||
# Install the built Mayan EDMS package
|
||||
&& pip install --no-cache-dir --no-use-pep517 dist/mayan* \
|
||||
&& pip install --no-cache-dir dist/mayan* \
|
||||
# Install the static content
|
||||
&& mayan-edms.py installjavascript \
|
||||
&& mayan-edms.py installdependencies \
|
||||
&& MAYAN_STATIC_ROOT=${PROJECT_INSTALL_DIR}/static mayan-edms.py preparestatic --link --noinput
|
||||
|
||||
COPY --chown=mayan:mayan requirements/testing-base.txt "${PROJECT_INSTALL_DIR}"
|
||||
|
||||
####
|
||||
# Final image - BASE_IMAGE + Mayan install directory from the builder image
|
||||
# Final image - base_image + builder_image artifact (Mayan install directory)
|
||||
####
|
||||
|
||||
FROM BASE_IMAGE
|
||||
FROM base_image
|
||||
|
||||
COPY --from=BUILDER_IMAGE --chown=mayan:mayan "${PROJECT_INSTALL_DIR}/" "${PROJECT_INSTALL_DIR}/"
|
||||
COPY --from=builder_image --chown=mayan:mayan "${PROJECT_INSTALL_DIR}/" "${PROJECT_INSTALL_DIR}/"
|
||||
|
||||
USER root
|
||||
|
||||
@@ -149,7 +156,7 @@ VOLUME ["/var/lib/mayan"]
|
||||
ENTRYPOINT ["entrypoint.sh"]
|
||||
|
||||
EXPOSE 8000
|
||||
CMD ["mayan"]
|
||||
CMD ["run_all"]
|
||||
|
||||
RUN ${PROJECT_INSTALL_DIR}/bin/mayan-edms.py platformtemplate supervisord_docker > /etc/supervisor/conf.d/mayan.conf \
|
||||
&& apt-get clean autoclean \
|
||||
|
||||
Reference in New Issue
Block a user