diff --git a/roundcube/testing/.env.example b/roundcube/testing/.env.example new file mode 100644 index 0000000..52ae539 --- /dev/null +++ b/roundcube/testing/.env.example @@ -0,0 +1,3 @@ +DATA_PATH= +CN= +MAIL_SERVER= diff --git a/roundcube/testing/Dockerfile b/roundcube/testing/Dockerfile new file mode 100644 index 0000000..a10023b --- /dev/null +++ b/roundcube/testing/Dockerfile @@ -0,0 +1,22 @@ +FROM roundcube/roundcubemail:1.4.11-apache + +RUN set -ex; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + git \ + ; \ + \ + curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer; \ + mv /usr/src/roundcubemail/composer.json-dist /usr/src/roundcubemail/composer.json; \ + \ + composer \ + --working-dir=/usr/src/roundcubemail/ \ + --prefer-dist --no-dev \ + --no-interaction \ + --optimize-autoloader --apcu-autoloader \ + update; + +RUN mkdir -p /etc/enigma/gnupg \ + && chown www-data:www-data /etc/enigma/gnupg \ + && cp /usr/src/roundcubemail/plugins/enigma/config.inc.php.dist /usr/src/roundcubemail/plugins/enigma/config.inc.php \ + && echo "\$config['enigma_pgp_homedir'] = '/etc/enigma/gnupg';" >> /usr/src/roundcubemail/plugins/enigma/config.inc.php diff --git a/roundcube/testing/docker-compose.yml b/roundcube/testing/docker-compose.yml new file mode 100644 index 0000000..79cd11f --- /dev/null +++ b/roundcube/testing/docker-compose.yml @@ -0,0 +1,43 @@ +version: "3.8" + +services: + app: + build: . + image: rc_test:latest + restart: unless-stopped + depends_on: + - db + volumes: + - ${DATA_PATH}/app:/var/www/html + - ${DATA_PATH}/enigma:/etc/enigma/gnupg + env_file: secrets/app.secrets + environment: + - ROUNDCUBEMAIL_SKIN=elastic + - ROUNDCUBEMAIL_DEFAULT_HOST=tls://${MAIL_SERVER} + - ROUNDCUBEMAIL_SMTP_SERVER=tls://${MAIL_SERVER} + - ROUNDCUBEMAIL_PLUGINS=archive, zipdownload, enigma, carddav + networks: + - default + - proxy + labels: + - "traefik.enable=true" + - "traefik.docker.network=proxy" + - "traefik.http.middlewares.rctest-redirect-websecure.redirectscheme.scheme=https" + - "traefik.http.routers.rctest-http.middlewares=rctest-redirect-websecure" + - "traefik.http.routers.rctest-http.rule=Host(`${CN}`)" + - "traefik.http.routers.rctest-http.entrypoints=web" + - "traefik.http.routers.rctest-https.rule=Host(`${CN}`)" + - "traefik.http.routers.rctest-https.entrypoints=websecure" + - "traefik.http.routers.rctest-https.tls=true" + - "traefik.http.routers.rctest-https.tls.certresolver=myhttpchallenge" + + db: + image: mariadb:10.5 + restart: unless-stopped + volumes: + - ${DATA_PATH}/db:/var/lib/mysql + env_file: secrets/db.secrets + +networks: + proxy: + external: true diff --git a/roundcube/testing/secrets/app.secrets.example b/roundcube/testing/secrets/app.secrets.example new file mode 100644 index 0000000..d8efa01 --- /dev/null +++ b/roundcube/testing/secrets/app.secrets.example @@ -0,0 +1,5 @@ +ROUNDCUBEMAIL_DB_TYPE= +ROUNDCUBEMAIL_DB_NAME= +ROUNDCUBEMAIL_DB_HOST= +ROUNDCUBEMAIL_DB_USER= +ROUNDCUBEMAIL_DB_PASSWORD= diff --git a/roundcube/testing/secrets/db.secrets.example b/roundcube/testing/secrets/db.secrets.example new file mode 100644 index 0000000..f51d9fb --- /dev/null +++ b/roundcube/testing/secrets/db.secrets.example @@ -0,0 +1,4 @@ +MYSQL_ROOT_PASSWORD= +MYSQL_PASSWORD= +MYSQL_DATABASE= +MYSQL_USER=