plone / demo.plone.org

https://demo.plone.org
MIT License
4 stars 1 forks source link

Demo sites are empty #36

Closed pbauer closed 2 months ago

pbauer commented 2 months ago

After the merge of https://github.com/plone/demo.plone.org/pull/35 both demo-sites are empty:

https://demo.plone.org https://classic.demo.plone.org

I guess make create-site needs to be added to the deployment-pipeline.

fredvd commented 2 months ago

@pbauer @ericof I checked the setup, but create-site is already called from the Dockerfile as the default entrypoint. And the site is created, otherwise it wouldn't be online because the plonesite itself would not exist and the volto frontend would have nothing to contact.

https://github.com/plone/demo.plone.org/blob/1de1cd48081698863554958bd37c7176789e0c1c/backend/Dockerfile#L28

I suspect something with the docker-entrypoint.sh script and the seleciton of the profile and distribution is not working out. installing the site locally now to debug.

fredvd commented 2 months ago

I can reproduce the issue locally, built the frontend from source, but the backend with 'make build-image'. then start the backend with my freshly built local image (replace the image_id):

docker run --rm -it -p 8080:8080 603eaf9a5cb8 create-site

But I don't get how this was runnign correctly before, becaus the create-site option just exits. The docker-entrypoint.sh comes from the official plone-backend image here:

https://github.com/plone/plone-backend/blob/416e5177ae29997c985da019b573bd17c0cf2981/skeleton/docker-entrypoint.sh#L154-L156

So if it only runs a script and then exits, the container is removed again and nothing happens. I wonder how this worked at all in the past.

We could update the docker-entrypoint.sh script with a create-site-start case where we execute runwsgi from the start case after creating the site.

pbauer commented 2 months ago

The file /app/scripts/create_site.py has nothing to do with the script scripts/create-site.py from this repo. it is https://github.com/plone/plone-backend/blob/6.0.x/skeleton/scripts/create_site.py because the Dockerfile uses FROM plone/plone-backend:${PLONE_VERSION}

pbauer commented 2 months ago

The create-site.py is this repo was basically copied from plone.edu. When building the image it is copied into the container next to create_site.py and the Dockerfile still ran create_site.py using docker-entrypoint.py:

elif  [[ "$1" == "create-site" ]]; then
  export TYPE=${TYPE:-volto}
  exec $sudo $VENVBIN/zconsole run etc/${CONF} /app/scripts/create_site.py

I now simply renamed the script here thus replacing the default from plone-backend and it worked :)

ericof commented 2 months ago

@pbauer I should have looked here before I tried to build locally (and, of course), it did work :-)

fredvd commented 2 months ago

Duh...... - vs _ :-)