Packages and Docker

Every now and then I’m developing new packages for ConcreteCMS. Have a WAMP setup locally, using PHPStorm for developing and debugging. Whenever the package is ready, I upload it to an test installation of ConcreteCMS and test is in a “real” environment. It works, but I think it could be better/smarter.
Yesterday I bumped into Docker and saw all the nice ready to use images with (current) versions of ConcreteCMS. Installed Docker Desktop, pulled some images, created containers and within just a blink I got a working Concrete5 installation, ready to be used. Very, very nice!
When developing new packages, what is the best way to incorporate Docker? Just have a local WAMP for developing and when ready, transfer package to the Docker container and install it there? Or is it possible to work directly with the files in the container?

As you can tell, I’m new to Docker. I think I can use this to my benefit. Can somebody tell me how they use Docker with ConcreteCMS (package) development (would be nice when it includes PHPStorm also…).

Happy programming! :slight_smile:

Take a look at this.

Though not tested, Michele really knows what he does!!

Yeah, already read that one! Any other workflows with Docker?

You can develop your package in a local directory, while it’s “mounted” in the docker image.

For example, if you start the docker image with:

docker run --rm -it -p 8080:80 -p 33306:3306 -v /path/to/your/package:/app/packages/package_handle ghcr.io/concrete5-community/docker5:9.2.2-full

You can develop on your PC the package at /path/to/your/package, and docker sees immediately those changes.
It’s really handy, you can easily check multiple Concrete versions and you don’t have to install anything (except docker).
The only downside is that your local development environment is “partial”: for example, you won’t have a “concrete/src” directory with all the Concrete classes, so no content assistance/autocompletion.
That’s why I usually work locally with a full Concrete setup, and use those docker images to test multiple Concrete versions and fine-tune stuff.

1 Like

This can be fixed by adding an include path in the IDE for the related package project. You need to choose the correct CMS version but it’s up to you. It’s not by default but it’s possible.