mirror of
https://github.com/zokradonh/kopano-docker.git
synced 2026-08-21 05:13:22 +00:00
add kweb config for z-push (#419)
* add kweb config for z-push * clean out apache bits from z-push container and use kopano_php as the base * fix commander tests for current php version * globally define log location for php-fpm error_log * move port in outer kweb config * rewrite other spellings of the autodiscover url * fix port in startup test * force plain output to buildkit * reorder z-push dockerfile
This commit is contained in:
+12
-35
@@ -1,6 +1,6 @@
|
||||
# syntax = docker/dockerfile:1.0-experimental
|
||||
ARG docker_repo=zokradonh
|
||||
FROM ${docker_repo}/kopano_base
|
||||
FROM ${docker_repo}/kopano_php
|
||||
|
||||
ARG ADDITIONAL_KOPANO_PACKAGES=""
|
||||
ARG DOWNLOAD_COMMUNITY_PACKAGES=1
|
||||
@@ -29,13 +29,12 @@ LABEL maintainer=az@zok.xyz \
|
||||
org.label-schema.version=$KOPANO_ZPUSH_VERSION \
|
||||
org.label-schema.schema-version="1.0"
|
||||
|
||||
VOLUME /var/lib/z-push/
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
# install Z-Push
|
||||
# TODO secret handling could go away when kopano_php is used as a base image
|
||||
# hadolint ignore=SC2215
|
||||
RUN --mount=type=secret,id=repocred,target=/etc/apt/auth.conf.d/kopano.conf \
|
||||
echo "deb [${KOPANO_REPOSITORY_FLAGS}] ${KOPANO_CORE_REPOSITORY_URL} ./" > /etc/apt/sources.list.d/kopano.list; \
|
||||
RUN \
|
||||
# prepare z-push installation
|
||||
echo "deb ${KOPANO_ZPUSH_REPOSITORY_URL} /" > /etc/apt/sources.list.d/zpush.list && \
|
||||
# this is the same key as for the rest of the Kopano stack, making a separate download anyways as this may not be the case in the future
|
||||
@@ -46,10 +45,7 @@ RUN --mount=type=secret,id=repocred,target=/etc/apt/auth.conf.d/kopano.conf \
|
||||
# TODO remove php-mbstring once https://jira.z-hub.io/browse/ZP-1541 is resolved
|
||||
# TODO remove php-xml once https://jira.z-hub.io/projects/ZP/issues/ZP-1558 is resolved
|
||||
apt-get update && apt-get install -y --no-install-recommends \
|
||||
apache2 \
|
||||
ca-certificates \
|
||||
crudini \
|
||||
libapache2-mod-php7.3 \
|
||||
php-mbstring \
|
||||
php-xml \
|
||||
z-push-autodiscover \
|
||||
@@ -60,6 +56,12 @@ RUN --mount=type=secret,id=repocred,target=/etc/apt/auth.conf.d/kopano.conf \
|
||||
${ADDITIONAL_KOPANO_PACKAGES} \
|
||||
&& rm -rf /var/cache/apt /var/lib/apt/lists
|
||||
|
||||
# Patch Gabsync to make it work
|
||||
# See https://jira.z-hub.io/browse/ZP-1463
|
||||
# https://forum.kopano.io/topic/1928/8-7-80-missing-php-files-in-php-mapi-deb-package-ubuntu-16-04
|
||||
# can be removed once gabsync is fixed - should not hurt
|
||||
RUN sed -i -e "s/set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH_CLI);/define('PATH_TO_ZPUSH', '..\/..\/backend\/kopano\/');\n set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH_CLI . PATH_SEPARATOR . BASE_PATH_CLI . PATH_TO_ZPUSH);/" /usr/share/z-push/tools/gab-sync/gab-sync.php
|
||||
|
||||
# tweak to make the container read-only
|
||||
RUN mkdir -p /tmp/z-push/ && \
|
||||
for i in /etc/z-push/*; do \
|
||||
@@ -67,37 +69,12 @@ RUN mkdir -p /tmp/z-push/ && \
|
||||
ln -s /tmp/z-push/"$(basename "$i")" "$i"; \
|
||||
done
|
||||
|
||||
COPY apache2-kopano.conf /etc/apache2/sites-available/kopano.conf
|
||||
|
||||
# configure basics
|
||||
# ensure right permissions of folders (should have been taked care of by the packaging, just for good measure)
|
||||
RUN \
|
||||
# configure apache
|
||||
rm /etc/apache2/sites-enabled/* && \
|
||||
sed -e 's,^ErrorLog.*,ErrorLog "|/bin/cat",' -i /etc/apache2/apache2.conf && \
|
||||
sed -e "s,MaxSpareServers[^:].*,MaxSpareServers 5," -i /etc/apache2/mods-available/mpm_prefork.conf && \
|
||||
a2disconf other-vhosts-access-log && \
|
||||
a2ensite kopano && \
|
||||
echo "Listen 80" > /etc/apache2/ports.conf && \
|
||||
# configure mod_php
|
||||
a2enmod rewrite && \
|
||||
crudini --set /etc/php/7.3/apache2/php.ini PHP upload_max_filesize 500M && \
|
||||
crudini --set /etc/php/7.3/apache2/php.ini PHP post_max_size 500M && \
|
||||
crudini --set /etc/php/7.3/apache2/php.ini PHP max_input_vars 1800 && \
|
||||
crudini --set /etc/php/7.3/apache2/php.ini Session session.save_path /run/sessions && \
|
||||
# configure z-push
|
||||
mkdir -p /var/lib/z-push /var/log/z-push && \
|
||||
chown www-data:www-data /var/lib/z-push /var/log/z-push
|
||||
|
||||
# Patch Gabsync to make it work
|
||||
# See https://jira.z-hub.io/browse/ZP-1463
|
||||
# https://forum.kopano.io/topic/1928/8-7-80-missing-php-files-in-php-mapi-deb-package-ubuntu-16-04
|
||||
# can be removed once gabsync is fixed - should not hurt
|
||||
RUN sed -i -e "s/set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH_CLI);/define('PATH_TO_ZPUSH', '..\/..\/backend\/kopano\/');\n set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH_CLI . PATH_SEPARATOR . BASE_PATH_CLI . PATH_TO_ZPUSH);/" /usr/share/z-push/tools/gab-sync/gab-sync.php
|
||||
|
||||
VOLUME /var/lib/z-push/
|
||||
|
||||
EXPOSE 80/tcp
|
||||
|
||||
COPY kweb.cfg /etc/kweb.cfg
|
||||
COPY start.sh /kopano/start.sh
|
||||
|
||||
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
||||
|
||||
Reference in New Issue
Block a user