roundcubemail-docker/tests/docker-compose.test-apache-postgres.yml
Pablo Zmdl 1d8ea95d37 Pre-setup and post-setup tasks
All executable files present in /entrypoint-tasks/pre-setup/ and
/entrypoint-tasks/post-setup/ are run at the beginning
or at the end, respectively, of the actual entrypoint-script.

Each of the executed files receive the CMD given to the container as their
arguments. This allows e.g. to change a plugin's config, or install a
technical requirement of a plugin that is to be installed.

This feature is not implemented in the images for Roundcube v1.5, since
they are not well maintained and will be dropped soon, anyways.
2025-11-03 14:19:08 +01:00

71 lines
2.1 KiB
YAML

version: "2"
services:
roundcubemail:
image: ${ROUNDCUBEMAIL_TEST_IMAGE:-roundcube/roundcubemail:latest-apache}
ports:
- 80:${HTTP_PORT:-80}
healthcheck:
# To make it obvious in logs "ping=ping" is added
test: ["CMD", "curl", "--fail", "http://localhost:${HTTP_PORT:-80}/?ping=ping"]
interval: 2s
timeout: 3s
retries: 30
start_period: 10s
depends_on:
roundcubedb:
condition: service_healthy
networks:
roundcube_test_net:
aliases:
- roundcubemail
environment:
- ROUNDCUBEMAIL_DB_TYPE=pgsql
- ROUNDCUBEMAIL_DB_HOST=roundcubedb # same as pgsql container name
- ROUNDCUBEMAIL_DB_NAME=roundcube # same as pgsql POSTGRES_DB env name
- ROUNDCUBEMAIL_DB_USER=roundcube # same as pgsql POSTGRES_USER env name
- ROUNDCUBEMAIL_DB_PASSWORD=roundcube # same as pgsql POSTGRES_PASSWORD env name
- ROUNDCUBEMAIL_SKIN=larry # Install non-default skin
volumes:
- "./pre-setup/:/entrypoint-tasks/pre-setup/"
- "./post-setup/:/entrypoint-tasks/post-setup/"
roundcubedb:
image: postgres:alpine
healthcheck:
# "roundcube" is the POSTGRES_USER value
test: ["CMD-SHELL", "pg_isready -U roundcube"]
interval: 2s
timeout: 3s
retries: 30
start_period: 10s
networks:
roundcube_test_net:
aliases:
- roundcubedb
environment:
- POSTGRES_DB=roundcube
- POSTGRES_USER=roundcube
- POSTGRES_PASSWORD=roundcube
# A name that matches Docker auto test naming, you want a name here is one
# Source: https://docs.docker.com/docker-hub/builds/automated-testing/#set-up-automated-test-files
sut:
image: alpine:3.14
networks:
roundcube_test_net:
depends_on:
roundcubemail:
condition: service_healthy
roundcubedb:
condition: service_healthy
command: /tests/run.sh
environment:
- ROUNDCUBE_URL=http://roundcubemail:${HTTP_PORT:-80}/
- SKIP_POST_SETUP_SCRIPT_TEST=${SKIP_POST_SETUP_SCRIPT_TEST:-no}
volumes:
- ./run.sh:/tests/run.sh:ro
working_dir: /tests
networks:
roundcube_test_net: