plone / plone-backend

Plone backend Docker images using Python 3 and pip.
GNU General Public License v2.0
12 stars 14 forks source link

How to start instance in fg? #64

Closed cekk closed 1 year ago

cekk commented 2 years ago

Is there a way to run this image in fg to debug addons?

I'm developing an add-on with plone-backend image and i need to put some pdb into its code but i don't know how to start the instance in fg.

I tried to bypass the entrypoint with command=bash but after that i don't know which script run and how.

Am i missing something or this isn't available yet? If not, how do you develop with plone6/pip?

avoinea commented 2 years ago

@cekk It's indeed a challenge as as after you figure out the command you'll notice it will fail with some undefined env variables:

Here is a demo working docker-compose.yml for eea.facetednavigation with the required environment variables:

https://github.com/collective/eea.facetednavigation/blob/bb540be19ae4af3bfa90f4fe58c7448bcaf8cc0f/docker-compose.yml#L12-L16

And the command you'll need to run within the container:

https://github.com/collective/eea.facetednavigation/blob/bb540be19ae4af3bfa90f4fe58c7448bcaf8cc0f/docker-compose.yml#L46-L47

cekk commented 2 years ago

damn, I started to put these ENV var manually but i didn't knew if it was the right way to do it.

Ok, with your example it works ;) thanks.

It could be nice to have these infos in the documentation, right? Or is it just temporary?

avoinea commented 2 years ago

Yes, we should add it to the docs. Also, it would be nice to have better defaults for those env variables in order not to care about them. But I'm not sure if zope.conf support it https://github.com/plone/plone-backend/blob/5.2.x/skeleton/etc/zope.conf

@ericof ^

cekk commented 2 years ago

Another thing: how to pin versions? i see VERSIONS env is missing and i don't see any way to use a custom requirements/constraints file.

ericof commented 2 years ago

@cekk You can always extend this image with something like:

ARG PLONE_VERSION=6.0.0b1
FROM plone/plone-backend:${PLONE_VERSION}

# Add local code
COPY . .
RUN ./bin/pip install -r requirements.txt \
    && chown -R plone: /app/*
cekk commented 2 years ago

right..sorry for dumb questions, but I finally have some time to play with it

jensens commented 1 year ago

I think we can close this.