Task #13489

Simplify debug mode configuration in Docker

Added by José Raddaoui Marín about 1 month ago. Updated about 1 month ago.

Status:VerifiedStart date:03/23/2021
Priority:MediumDue date:
Assignee:-% Done:

0%

Category:Docker
Target version:Release 2.7.0
Google Code Legacy ID: Tested version:
Sponsored:No Requires documentation:

Description

Currently, accessing qubit_dev.php to set up the debug mode in the Docker environment can be complicated. The environment contains a couple of variables to configure it:

ATOM_DEVELOPMENT_MODE: https://github.com/artefactual/atom/blob/qa/2.x/docker/etc/environment#L14
ATOM_DEBUG_IP: https://github.com/artefactual/atom/blob/qa/2.x/docker/etc/environment#L21

The first one is only used to expose_php and opcache.validate_timestamps in php.ini, and the second one is set to one of the gateways that Docker's default network could use. However, this gateway is likely to change in different hosts and, in order to set it up properly you need to find the network and gateway first ...

docker network ls
docker network inspect docker_default

And then update the environment file and recreate the container (but not the network). This process is a bit tedious, requires some knowledge and it introduces changes in the source code that you don't want to commit.

Proposed solution

Ideally, if ATOM_DEVELOPMENT_MODE is enabled, qubit_dev.php should be easily accessible from the Docker host. We should be able to get the container's network gateway in the bootstrap process and update the env[ATOM_DEBUG_IP] accordingly in the PHP-FPM pool configuration.

History

#1 Updated by José Raddaoui Marín about 1 month ago

  • Status changed from In progress to Code Review
  • Assignee deleted (José Raddaoui Marín)

#2 Updated by José Raddaoui Marín about 1 month ago

  • Description updated (diff)

#3 Updated by José Raddaoui Marín about 1 month ago

  • Status changed from Code Review to QA/Review
  • Assignee set to David Juhasz

David, would you like to give it a try to this one too?

#4 Updated by David Juhasz about 1 month ago

  • Status changed from QA/Review to Feedback

Accessing http://localhost:63001/qubit_dev.php works for me (Docker Desktop on Windows 10 with WSL2). :)

One small improvement would be to add a symlink to the symfony debug widget in the atom docker container:

ln -s /atom/src/vendor/symfony/data/web/sf /atom/src/sf

#5 Updated by José Raddaoui Marín about 1 month ago

  • Status changed from Feedback to In progress
  • Assignee changed from David Juhasz to José Raddaoui Marín

That's great feedback, thanks David. I think I already have it in there because I used the web installer at some point, but that may not happen at all ...

https://github.com/artefactual/atom/blob/qa/2.x/plugins/sfInstallPlugin/lib/sfInstall.class.php#L550

#6 Updated by José Raddaoui Marín about 1 month ago

  • Status changed from In progress to Code Review
  • Assignee changed from José Raddaoui Marín to David Juhasz

#7 Updated by José Raddaoui Marín about 1 month ago

  • Status changed from Code Review to Verified
  • Assignee deleted (David Juhasz)

Thanks David. Merged in qa/2.x.

Also available in: Atom PDF