Part of LibreSign/libresign#8969.
Context
nextcloud-docker-development already supports multiple independent development environments on the same host.
Each clone has its own filesystem/volume structure, and Compose project naming provides an additional namespace for containers and networks.
LibreSign wants to reuse this isolation model for parallel Behat workers instead of creating a second test-environment implementation.
To serve the complete LibreSign Behat matrix, the environment must support the four database backends currently exercised by LibreSign:
- SQLite;
- MySQL;
- MariaDB;
- PostgreSQL.
SQLite support is tracked in #141.
MariaDB support is tracked in #142.
Goal
Provide a stable, reusable automation contract that allows a CI/test consumer to create, use and destroy multiple isolated Nextcloud test environments concurrently on one host across the supported PHP, Nextcloud and database matrix.
The implementation must remain generic to Nextcloud development/testing and must not embed LibreSign-specific business behavior.
Worker contract
A caller must be able to select a worker using environment/configuration values without editing Compose files or scripts.
Use the following database-selection contract:
DB_TYPE=sqlite|mysql|mariadb|pgsql
DB_TYPE selects the database backend.
For service-backed databases, DB_HOST remains the connection/service host and should default consistently with the selected backend.
Existing MySQL/PostgreSQL callers that only use the current DB_HOST behavior must either remain compatible or receive an explicit migration path documented in the same change. Do not silently reinterpret a hostname as a database type.
The worker lifecycle must also allow callers to select:
PHP_VERSION;
VERSION_NEXTCLOUD;
DB_TYPE;
- backend-specific supported version/configuration values where applicable.
Required lifecycle
The environment must expose a reliable non-interactive way to perform the equivalent of:
- create worker environment;
- select PHP / Nextcloud / database configuration;
- start only the services required by that database backend;
- install/configure Nextcloud;
- make an app checkout available;
- execute commands/tests against the worker;
- collect diagnostics;
- destroy only that worker environment.
The exact script/command names are implementation details, but the caller-facing behavior above is required.
Database matrix
SQLite
Tracked by #141.
- no external database container is required;
- database state lives inside the worker's isolated Nextcloud filesystem;
- the PHP image includes the required SQLite extensions.
MySQL
Preserve the existing supported MySQL development path.
MariaDB
Tracked by #142.
- MariaDB is selected explicitly with
DB_TYPE=mariadb;
- the caller can select the supported MariaDB version without editing Compose YAML;
- initial support covers MariaDB 10.6 and 10.11.
PostgreSQL
Preserve the existing supported PostgreSQL development path.
Isolation
Workers must have separate mutable state for:
- clone/workspace directory;
- Compose project/network;
- Nextcloud configuration;
- Nextcloud data;
- database data;
- mail state where applicable;
- temporary/runtime files;
- logs and test artifacts.
Stopping or cleaning one worker must not stop or delete another worker's resources.
Shared immutable Docker images/caches are allowed.
Concurrency verification
Add automated coverage proving that at least two workers can coexist.
The test must use conflicting logical state so it detects accidental sharing, for example worker A and worker B set the same Nextcloud-visible key/resource to different values and each continues to observe its own value.
Run this isolation proof against at least one service-backed database and SQLite.
Database-specific children must separately prove their backend state is isolated.
CI suitability
The lifecycle must:
- be non-interactive;
- return meaningful failure codes;
- permit deterministic worker/project names supplied by the caller;
- clean up worker-specific resources after success or failure;
- make relevant logs discoverable;
- avoid requiring fixed host ports for worker-to-worker isolation;
- preserve existing local development use.
Security boundary
The repository documentation already states that its proxy infrastructure can access the Docker daemon.
Treat the Docker daemon as a trust boundary.
The lifecycle is suitable for isolated/ephemeral CI runners or trusted local code. Do not present Compose project names as a security boundary between mutually untrusted workloads sharing the same Docker daemon.
Performance
Reuse immutable images and caches where safe.
Do not share mutable Nextcloud/database state to reduce setup time.
Performance optimization must not weaken worker isolation.
Done when
Part of LibreSign/libresign#8969.
Context
nextcloud-docker-developmentalready supports multiple independent development environments on the same host.Each clone has its own filesystem/volume structure, and Compose project naming provides an additional namespace for containers and networks.
LibreSign wants to reuse this isolation model for parallel Behat workers instead of creating a second test-environment implementation.
To serve the complete LibreSign Behat matrix, the environment must support the four database backends currently exercised by LibreSign:
SQLite support is tracked in #141.
MariaDB support is tracked in #142.
Goal
Provide a stable, reusable automation contract that allows a CI/test consumer to create, use and destroy multiple isolated Nextcloud test environments concurrently on one host across the supported PHP, Nextcloud and database matrix.
The implementation must remain generic to Nextcloud development/testing and must not embed LibreSign-specific business behavior.
Worker contract
A caller must be able to select a worker using environment/configuration values without editing Compose files or scripts.
Use the following database-selection contract:
DB_TYPE=sqlite|mysql|mariadb|pgsqlDB_TYPEselects the database backend.For service-backed databases,
DB_HOSTremains the connection/service host and should default consistently with the selected backend.Existing MySQL/PostgreSQL callers that only use the current
DB_HOSTbehavior must either remain compatible or receive an explicit migration path documented in the same change. Do not silently reinterpret a hostname as a database type.The worker lifecycle must also allow callers to select:
PHP_VERSION;VERSION_NEXTCLOUD;DB_TYPE;Required lifecycle
The environment must expose a reliable non-interactive way to perform the equivalent of:
The exact script/command names are implementation details, but the caller-facing behavior above is required.
Database matrix
SQLite
Tracked by #141.
MySQL
Preserve the existing supported MySQL development path.
MariaDB
Tracked by #142.
DB_TYPE=mariadb;PostgreSQL
Preserve the existing supported PostgreSQL development path.
Isolation
Workers must have separate mutable state for:
Stopping or cleaning one worker must not stop or delete another worker's resources.
Shared immutable Docker images/caches are allowed.
Concurrency verification
Add automated coverage proving that at least two workers can coexist.
The test must use conflicting logical state so it detects accidental sharing, for example worker A and worker B set the same Nextcloud-visible key/resource to different values and each continues to observe its own value.
Run this isolation proof against at least one service-backed database and SQLite.
Database-specific children must separately prove their backend state is isolated.
CI suitability
The lifecycle must:
Security boundary
The repository documentation already states that its proxy infrastructure can access the Docker daemon.
Treat the Docker daemon as a trust boundary.
The lifecycle is suitable for isolated/ephemeral CI runners or trusted local code. Do not present Compose project names as a security boundary between mutually untrusted workloads sharing the same Docker daemon.
Performance
Reuse immutable images and caches where safe.
Do not share mutable Nextcloud/database state to reduce setup time.
Performance optimization must not weaken worker isolation.
Done when
DB_TYPE=sqlite|mysql|mariadb|pgsqlis supported and documented.