Continuing the discussion from Building a Custom version of the Plone backend image with our own addon:
I now have a custom docker image, I just need to know if I'm doing things properly.
I want to ensure that my.profile is activated when my image runs...
... so this is command I'm using:
docker run -p 8080:8080 -e SITE="Plone" -e TYPE="classic" -e PROFILES="my.profile:default collective.easyform:default" -v $(pwd)/var/import:/app/import site
The output is telling me that this is a bad idea once I'm in production...
Creating Plone classic SITE: Plone
Aditional profiles: my.profile:default collective.easyform:default
THIS IS NOT MEANT TO BE USED IN PRODUCTION
Read about it: https://github.com/plone/plone-backend/#extending-from-this-image
The additional reading that they suggest is not helping.....
What should I do in order to have an image with the profiles I need activated?
I think the warning about using the image in production is not related to the profiles specifically, but about where the data is stored.
For a production site, you would want to run the image with environment variables to connect to a ZEO server or Relstorage.
Is that it, @ericof, or is there more to the warning than that?
So it IS safe to use profiles in this manner I'm doing now?
BTW... at minimum, I plan to use docker-compose in production, maybe something slightly fancier (we'll see).
Then add external RelStorage of course.....
I've updated the way I configure my backend image.
My Dockerfile now looks like this:
COPY src/site.content /app/src/site.content
COPY src/site.customviews /app/src/site.customviews
COPY src/site.plone /app/src/site.plone
COPY src/site.profile /app/src/site.profile
COPY src/plonetheme.fourteen /app/src/plonetheme.fourteen
COPY requirements.txt /app/requirements.txt
RUN apt-get update \
&& apt-get install -y --no-install-recommends gcc \
&& rm -rf /var/lib/apt/lists/*
RUN /app/bin/pip install -r /app/requirements.txt
I place a
requirements.txt in the same folder as the Dockerfile and the
requirements.txt now does all the "heavy lifting" as it should.
It looks like this:
Note the remote inclusion of the Plone 6 constraints.txt (very important). Also, my working assumption is that I need to apt-get gcc because my addons require compiling of stuff.