From 21a71eeeff3e74a5b6c780f33be5ac6ad62b5d90 Mon Sep 17 00:00:00 2001 From: bvn13 Date: Sat, 4 Jul 2026 20:11:29 +0300 Subject: [PATCH] roundcube fixes --- config/roundcube/Dockerfile | 9 +++++++++ config/roundcube/entrypoint.sh | 17 +++++++++++++++++ docker-compose.yml.template | 4 ++-- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 config/roundcube/Dockerfile create mode 100644 config/roundcube/entrypoint.sh diff --git a/config/roundcube/Dockerfile b/config/roundcube/Dockerfile new file mode 100644 index 0000000..8bb5d30 --- /dev/null +++ b/config/roundcube/Dockerfile @@ -0,0 +1,9 @@ +FROM roundcube/roundcubemail:latest-apache + +COPY entrypoint.sh /entrypoint-custom.sh +COPY docker-override.inc.php /docker-override.inc.php + +RUN chmod +x /entrypoint-custom.sh + +ENTRYPOINT ["/entrypoint-custom.sh"] +CMD ["apache2-foreground"] diff --git a/config/roundcube/entrypoint.sh b/config/roundcube/entrypoint.sh new file mode 100644 index 0000000..e4a52e0 --- /dev/null +++ b/config/roundcube/entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -e + +# Запускаем оригинальный entrypoint в фоне +/docker-entrypoint.sh "$@" & +PID=$! + +# Ждём пока конфиг сгенерируется +while [ ! -f /var/www/html/config/config.inc.php ]; do + sleep 1 +done + +# Добавляем require_once если его ещё нет +grep -q "docker-override" /var/www/html/config/config.inc.php || \ + echo "require_once '/var/www/html/config/docker-override.inc.php';" >> /var/www/html/config/config.inc.php + +wait $PID diff --git a/docker-compose.yml.template b/docker-compose.yml.template index 3401b79..9890265 100644 --- a/docker-compose.yml.template +++ b/docker-compose.yml.template @@ -60,14 +60,14 @@ services: - mail roundcube: - image: roundcube/roundcubemail:latest-apache + build: ./config/roundcube + #image: roundcube/roundcubemail:latest-apache container_name: roundcube restart: unless-stopped ports: - "8888:80" # веб-интерфейс почты, менять при конфликте volumes: - ./data/roundcube:/var/roundcube/db - - ./config/roundcube/docker-override.inc.php:/var/www/html/config/docker-override.inc.php environment: # IMAP — подключаемся к stalwart внутри сети ROUNDCUBEMAIL_DEFAULT_HOST: "ssl://stalwart"