Skip to content

Add Docker development and test stack - #8779

Closed
azad-sw-at wants to merge 1 commit into
chamilo:2.0from
azad-sw-at:2.0
Closed

Add Docker development and test stack#8779
azad-sw-at wants to merge 1 commit into
chamilo:2.0from
azad-sw-at:2.0

Conversation

@azad-sw-at

Copy link
Copy Markdown

Runs Chamilo 2.0 locally with only Docker installed — no host PHP, MySQL, Node.js or Apache. Covers the app plus all four test tiers (PHPUnit, Behat, PHPStan/Psalm, ECS).

docker/setup.sh build, start, install the portal, prepare the test DB
docker/test.sh run any test tier
docker/set-port.sh change the published port consistently

Services: PHP 8.2 + Apache, MariaDB 10.11, Redis, Mailpit, Selenium. All images are multi-arch, so this works on both Intel and Apple Silicon.

Notes on the less obvious choices, all documented in docker/README.md:

  • Apache listens on 8380 inside the container and is published on the same host port. Chamilo persists root_web at install time, so the container port and the browser port must match or every redirect breaks.
  • Selenium is pinned to 4.1.4. behat/mink-selenium2-driver 1.7 speaks only the legacy JSON Wire protocol; newer grids reject it outright.
  • Behat uses tests/behat/behat.docker.yml rather than BEHAT_PARAMS, because Behat 3.29 lets the file config win over the environment variable.
  • .env is never created empty. Symfony falls back to .env.dist only when .env is absent, and that fallback supplies the pre-install defaults.
  • .env.local / .env.test.local stay gitignored but are generated from templates in docker/env/, since the stack cannot start without them.

Docs: SETUP.md is the step-by-step guide; docker/README.md explains the design.

Runs Chamilo 2.0 locally with only Docker installed — no host PHP, MySQL,
Node.js or Apache. Covers the app plus all four test tiers (PHPUnit, Behat,
PHPStan/Psalm, ECS).

  docker/setup.sh      build, start, install the portal, prepare the test DB
  docker/test.sh       run any test tier
  docker/set-port.sh   change the published port consistently

Services: PHP 8.2 + Apache, MariaDB 10.11, Redis, Mailpit, Selenium. All
images are multi-arch, so this works on both Intel and Apple Silicon.

Notes on the less obvious choices, all documented in docker/README.md:

- Apache listens on 8380 *inside* the container and is published on the same
  host port. Chamilo persists root_web at install time, so the container port
  and the browser port must match or every redirect breaks.
- Selenium is pinned to 4.1.4. behat/mink-selenium2-driver 1.7 speaks only the
  legacy JSON Wire protocol; newer grids reject it outright.
- Behat uses tests/behat/behat.docker.yml rather than BEHAT_PARAMS, because
  Behat 3.29 lets the file config win over the environment variable.
- .env is never created empty. Symfony falls back to .env.dist only when .env
  is absent, and that fallback supplies the pre-install defaults.
- .env.local / .env.test.local stay gitignored but are generated from
  templates in docker/env/, since the stack cannot start without them.

Docs: SETUP.md is the step-by-step guide; docker/README.md explains the design.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@azad-sw-at azad-sw-at closed this by deleting the head repository Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant