Docker plone-backend and addon development

I'm looking at the documentation plone/plone-backend – Install Plone 6 – Containers – Official Images — Plone Documentation v6.0-dev
But I'm not seeing how to do add-on development with the plone-backend docker images

This is the command I'm using

docker run -p 8090:8080  -e PLONE_DEVELOP="src/my.content" -e ADDONS="my.content" -e SITE="Plone" -e TYPE="classic" -v $(pwd)/src:/opt/plone/backend/src  plone/plone-backend:6.0.0a4

BTW... it looks like the path in the container changed from previous docker images, which used to hold the src at /plone/instance/src, seems everything is now under /opt/plone/backend

I'm using the volume (-v) to mount the src folder as this is where my custom addon is located.
What I'm seeing is an error.

ERROR: Could not find a version that satisfies the requirement my.content (from versions: none)
ERROR: No matching distribution found for my.content
WARNING: You are using pip version 22.0.4; however, version 22.1.2 is available.
You should consider upgrading via the '/app/bin/python -m pip install --upgrade pip' command.

See this discussion, it may help: Run local acceptence tests with local backend add-on (plone.restapi) - #3 by ksuess

@tiberiuichim …based on the discussion you referenced, I’ll need to map my volume to /app/src

I’ll try that and report the outcome.

It works with /app/src.
This command worked for me:

docker run -p 8090:8080  -e PLONE_DEVELOP="src/my.content" -e ADDONS="my.content" -e SITE="Plone" -e TYPE="classic" -v $(pwd)/src:/app/src  plone/plone-backend:6.0.0a4

The only thing non-standard is that I use port 8090 instead of the more common 8080.

The information is actually available in the Plone 6 docs:

updated url above: https://6.docs.plone.org/install/containers/images/backend.html#containers-images-backend-developing-packages-label

Hi!

usually an addon is developed using plonecli/cookieplone/buildout and can deployed in another environment, for example used with the plone docker images. I would like to be able to develop using docker directly. There's the guide above that works very well, running docker mounting a local src.

You need to restart the container at every src change, so I'm asking if there are better/new ways to do it. I think the problem is in Python that need to parse all the referenced code, is there a Python support to hot reload or a proposal on it?

In any case, programming with AI will reduce the time spent on debugging/developing code, so perhaps it is becoming a minor issue. What is your opinion?

We gave up trying to develop with docker both for Plone and Django in our team.

IMO the current cookieplone project setup using Makefiles and uv is fast enough, and it is isolated enough in its own virtualenv, to easily develop and not to worry about python dependencies.

There was plone.reload to reload the modified python code that you have actually running, but I haven't used it for years, so I don't know whether it would work in a Docker setup with a mounted src directory.

1 Like

I dont use volto, only classic ui, and I also gave up docker for local plone development. It took too long to restart the container.

Nowadays I use mxmake because I have multiple related projects that needs to be developer at the same time. Using mxmake was the simplest option (just a couple of files) using uv makes it super fast.

i also use GitHub - plone/plone.app.debugtoolbar: Debug toolbar for Plone (it uses plone.reload under the hood) but does not works in some cases. But with uv restarting zope/plone is realy fast, so I tend to just do a restart anyways.

2 Likes