Plone backend Docker images using Python 3 and pip.
NOTE: These images are not yet officially supported by the Plone Community.
latest, 5.2, 5.2.6, 5.2.6-python38
(5.2/5.2.6/Dockerfile.python38)5.2.6-python37
(5.2/5.2.6/Dockerfile.python37)5.2.6-python36
(5.2/5.2.6/Dockerfile.python36)
6.0.0a1, 6.0.0a1-python39
(6.0/6.0.0a1/Dockerfile.python39)6.0.0a1-python38
(6.0/6.0.0a1/Dockerfile.python38)6.0.0a1-python37
(6.0/6.0.0a1/Dockerfile.python37)6.0-dev, 6.0-dev-python39
(6.0/6.0-dev/Dockerfile.python39)6.0-dev-python38
(6.0/6.0-dev/Dockerfile.python38)6.0-dev-python37
(6.0/6.0-dev/Dockerfile.python37)
docker run -p 8080:8080 plone/plone-backend:6.0.0a1
Then point your browser at http://localhost:8080 and you should see the default Plone site creation page.
This image supports ZEO clusters natively, and to use it
Create a directory for your project, and inside it create a docker-compose.yml
file that starts your Plone instance and the ZEO instance with volume mounts for data persistence:
version: "3"
services:
backend:
image: plone/plone-backend:6.0.0a1
restart: always
environment:
ZEO_ADDRESS: zeo:8100
ports:
- "8080:8080"
depends_on:
- zeo
zeo:
image: plone/plone-zeo:latest
restart: always
volumes:
- data:/data
ports:
- "8100:8100"
volumes:
data: {}
Now, run docker-compose up -d
from your project directory.
Point your browser at http://localhost:8080 and you should see the default Plone site creation page.
There are several ways to store data used by applications that run in Docker containers.
We encourage users of the Plone
images to familiarize themselves with the options available.
The Docker documentation is a good starting point for understanding the different storage options and variations.
In a directory create a Dockerfile
file:
FROM plone/plone-backend:6.0.0a1
RUN ./bin/pip install "relstorage==3.4.5" "psycopg[binary]==3.0.1 --use-deprecated legacy-resolver"
Also create a requirements.txt
file, with packages to be installed:
pas.plugin.authomatic
Build your new image
docker build . -t myproject:latest -f Dockerfile
And start a container with
docker run -p 8080:8080 myproject:latest
It is possible to install, during startup time, addons in a container created using this image. To do so, pass the ADDONS environment variable with a list (separated by space) of requirements to be added to the image:
docker run -p 8080:8080 -e ADDONS="pas.plugins.authomatic" plone/plone-backend:6.0.0a1
This approach also allows you to test Plone with a specific version of one of its core components
docker run -p 8080:8080 -e ADDONS="plone.volto==3.1.0a3" plone/plone-backend:6.0.0a1
NOTE: We advise against using this feature on production environments. In this case, extend the image as explained before.
Environment variable | Zope option | Default value |
---|---|---|
DEBUG_MODE | debug-mode | off |
SECURITY_POLICY_IMPLEMENTATION | security-policy-implementation | C |
VERBOSE_SECURITY | verbose-security | false |
DEFAULT_ZPUBLISHER_ENCODING | default-zpublisher-encoding | utf-8 |
To use a ZEO database, you need to pass the ZEO_ADDRESS to the image:
version: "3"
services:
backend:
image: plone/plone-backend:6.0.0a1
restart: always
environment:
ZEO_ADDRESS: zeo:8100
ports:
- "8080:8080"
depends_on:
- zeo
zeo:
image: plone/plone-zeo:latest
restart: always
volumes:
- data:/data
ports:
- "8100:8100"
volumes:
data: {}
A list of supported environment variables for ZEO:
Environment variable | ZEO option | Default value |
---|---|---|
ZEO_SHARED_BLOB_DIR | name | off |
ZEO_READ_ONLY | read-only | false |
ZEO_CLIENT_READ_ONLY_FALLBACK | read-only-fallback | false |
ZEO_STORAGE | storage | 1 |
ZEO_CLIENT_CACHE_SIZE | cache-size | 128MB |
ZEO_DROP_CACHE_RATHER_VERIFY | drop-cache-rather-verify | false |
NOTE: Currently this image supports only the configuration of PostgreSQL backends via configuration variables. If you need to you MySQL or Oracle we recommend you to extend this image and overwrite the
/app/etc/relstorage.conf
file.
To use a PostgreSQL database, you need to pass the RELSTORAGE_DSN to the image:
version: "3"
services:
backend:
image: plone/plone-backend:6.0.0a1
environment:
RELSTORAGE_DSN: "dbname='plone' user='plone' host='db' password='plone'"
ports:
- "8080:8080"
depends_on:
- db
db:
image: postgres
environment:
POSTGRES_USER: plone
POSTGRES_PASSWORD: plone
POSTGRES_DB: plone
ports:
- "5432:5432"
A valid PostgreSQL DSN is a list of parameters separated with whitespace. A typical DSN looks like dbname='zodb' user='username' host='localhost' password='pass'
.
A list of supported environment variables for Relstorage:
Environment variable | RelStorage option | Default value |
---|---|---|
RELSTORAGE_NAME | name | storage |
RELSTORAGE_READ_ONLY | read-only | off |
RELSTORAGE_KEEP_HISTORY | keep-history | true |
RELSTORAGE_COMMIT_LOCK_TIMEOUT | commit-lock-timeout | 30 |
RELSTORAGE_CREATE_SCHEMA | create-schema | true |
RELSTORAGE_SHARED_BLOB_DIR | shared-blob-dir | false |
RELSTORAGE_BLOB_CACHE_SIZE | blob-cache-size | 100mb |
RELSTORAGE_BLOB_CACHE_SIZE_CHECK | blob-cache-size-check | 10 |
RELSTORAGE_BLOB_CACHE_SIZE_CHECK_EXTERNAL | blob-cache-size-check-external | false |
RELSTORAGE_BLOB_CHUNK_SIZE | blob-chunk-size | 1048576 |
RELSTORAGE_CACHE_LOCAL_MB | cache-local-mb | 10 |
RELSTORAGE_CACHE_LOCAL_OBJECT_MAX | cache-local-object-max | 16384 |
RELSTORAGE_CACHE_LOCAL_COMPRESSION | cache-local-compressione | none |
RELSTORAGE_CACHE_DELTA_SIZE_LIMIT | cache-delta-size-limit | 100000 |
Please DO NOT commit to main directly. Even for the smallest and most trivial fix. ALWAYS open a pull request and ask somebody else to merge your code. NEVER merge it yourself.
The project is licensed under the GPLv2.