mirror of
https://github.com/zokradonh/kopano-docker.git
synced 2026-08-24 22:55:36 +00:00
prepare changes to run kdav through kweb as well (#424)
* prepare changes to run kdav through kweb as well * add kdav configuration * add remaining kdav configuration for kweb * import remaining kweb/php-fpm config from https://stash.kopano.io/projects/PKG/repos/kopano-one-php-fpm/browse
This commit is contained in:
+13
-39
@@ -2,11 +2,11 @@
|
||||
ARG docker_repo=zokradonh
|
||||
FROM composer:1.9 as builder
|
||||
|
||||
RUN git clone --depth 1 https://stash.kopano.io/scm/kc/kdav.git /usr/share/kdav
|
||||
WORKDIR /usr/share/kdav
|
||||
RUN git clone --depth 1 https://stash.kopano.io/scm/kc/kdav.git /usr/share/kopano-kdav
|
||||
WORKDIR /usr/share/kopano-kdav
|
||||
RUN composer install
|
||||
|
||||
FROM ${docker_repo}/kopano_base
|
||||
FROM ${docker_repo}/kopano_php
|
||||
|
||||
ARG ADDITIONAL_KOPANO_PACKAGES=""
|
||||
ARG DOWNLOAD_COMMUNITY_PACKAGES=1
|
||||
@@ -30,18 +30,11 @@ LABEL maintainer=az@zok.xyz \
|
||||
org.label-schema.schema-version="1.0"
|
||||
|
||||
# install Kopano kDAV
|
||||
# hadolint ignore=SC2215
|
||||
RUN --mount=type=secret,id=repocred,target=/etc/apt/auth.conf.d/kopano.conf \
|
||||
# apt key for this repo has already been installed in base
|
||||
echo "deb [${KOPANO_REPOSITORY_FLAGS}] ${KOPANO_CORE_REPOSITORY_URL} ./" > /etc/apt/sources.list.d/kopano.list; \
|
||||
RUN \
|
||||
set -x && \
|
||||
apt-get update && apt-get install -y --no-install-recommends \
|
||||
apache2 \
|
||||
libapache2-mod-php7.3 \
|
||||
crudini \
|
||||
php7-mapi \
|
||||
php-xml \
|
||||
php-mbstring \
|
||||
php-xml \
|
||||
php-zip \
|
||||
sqlite \
|
||||
php-sqlite3 \
|
||||
@@ -49,40 +42,21 @@ 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/*
|
||||
|
||||
COPY apache2-kopano-kdav.conf /etc/apache2/sites-available/kopano-kdav.conf
|
||||
|
||||
# configure basics
|
||||
# ensure right permissions of folders
|
||||
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-kdav && \
|
||||
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 && \
|
||||
mkdir -p /var/lib/kopano/kdav && \
|
||||
chown www-data:www-data /var/lib/kopano/kdav && \
|
||||
mkdir -p /var/log/kdav && \
|
||||
chown www-data:www-data /var/log/kdav
|
||||
mkdir -p /var/lib/kopano/kdav /var/log/kdav && \
|
||||
chown www-data:www-data /var/lib/kopano/kdav /var/log/kdav
|
||||
|
||||
COPY --from=builder /usr/share/kdav /usr/share/kdav
|
||||
COPY --from=builder /usr/share/kopano-kdav /usr/share/kopano-kdav
|
||||
|
||||
# tweaks to make the container read-only
|
||||
RUN \
|
||||
mv /usr/share/kdav/config.php /usr/share/kdav/config.php.dist && \
|
||||
ln -s /tmp/config.php /usr/share/kdav/config.php
|
||||
|
||||
EXPOSE 80/tcp
|
||||
mv /usr/share/kopano-kdav/config.php /usr/share/kopano-kdav/config.php.dist && \
|
||||
ln -s /tmp/config.php /usr/share/kopano-kdav/config.php
|
||||
|
||||
COPY kopano-kdav.conf /etc/php/7.3/fpm/pool.d/
|
||||
COPY start.sh /kopano/start.sh
|
||||
|
||||
ENV LANG en_US.UTF-8
|
||||
COPY kweb.cfg /etc/kweb.cfg
|
||||
|
||||
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
||||
CMD [ "/kopano/start.sh" ]
|
||||
|
||||
Reference in New Issue
Block a user