diff --git a/core/Dockerfile b/core/Dockerfile index 54d8cea..d7bffaa 100644 --- a/core/Dockerfile +++ b/core/Dockerfile @@ -1,34 +1,29 @@ # syntax=docker/dockerfile:1.3-labs FROM ubuntu:20.04 -# install apt packages -WORKDIR /root -RUN </etc/apt/sources.list.d/z-push.list apt-get update -apt-get install -y z-push-kopano z-push-config-apache z-push-backend-kopano +apt-get install -y z-push-kopano z-push-backend-kopano z-push-config-apache z-push-config-apache-autodiscover +apt-get install -f -y --no-install-recommends +# cleanup apt-get autoclean rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache ~/.npm rm -rf core-11.0.2.50.507cbae-Ubuntu_20.04-amd64 EOF # use envsubst in entrypoint script to convert config templates to actual config files +COPY --chmod=0775 entrypoint.sh /entrypoint.sh EXPOSE 80 +VOLUME /etc/z-push VOLUME /var/lib/z-push -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/entrypoint.sh"] +CMD ["apache2", "-DFOREGROUND"] diff --git a/z-push/build.sh b/z-push/build.sh index eb21823..841a818 100644 --- a/z-push/build.sh +++ b/z-push/build.sh @@ -2,16 +2,11 @@ # export DOCKER_BUILDKIT=1 docker run -d --rm --name www -p80:80 -v/root/kopano-docker/dist:/usr/local/apache2/htdocs httpd docker build --no-cache --progress=plain -t z-push . -docker run --rm -it --name z-push \ - -e "MAIL_DOMAIN=ads65.de" \ - -e "APACHE_RUN_DIR=/var/www" \ - -e "APACHE_RUN_USER=www-data" \ - -e "APACHE_RUN_GROUP=www-data" \ - -e "APACHE_LOG_DIR=/var/log" \ - -e "APACHE_PID_FILE=/var/run/apache2/apache2.pid" \ - z-push +docker build -t z-push . +docker run --rm -it --name z-push -p8081:80 z-push bash docker logs -f z-push docker exec -it z-push bash +docker run --rm -it ubuntu:20.04 docker kill z-push docker rm z-push diff --git a/z-push/entrypoint.sh b/z-push/entrypoint.sh new file mode 100644 index 0000000..6fbba38 --- /dev/null +++ b/z-push/entrypoint.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -e +export APACHE_RUN_DIR=/var/www +export APACHE_RUN_USER=www-data +export APACHE_RUN_GROUP=www-data +export APACHE_LOG_DIR=/var/log/apache2 +export APACHE_PID_FILE=/var/run/apache2/apache2.pid +exec "$@"