Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion docs/install/containers/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ myst:

# Examples of Plone 6 using containers

This section provides examples of how to use Plone 6 with container orchestration tools and various deployment configurations.

```{toctree}
:maxdepth: 2
:hidden: true
Expand All @@ -21,7 +23,47 @@ haproxy-plone-zeo
traefik-volto-plone-varnish
```

Examples of projects running Plone using `docker compose`.
## Container orchestration

Plone 6 can be deployed using various container orchestration tools:

### Docker Compose

Most examples in this section use {term}`Docker Compose` for orchestrating multiple containers.
Docker Compose is ideal for development, testing, and small to medium deployments.

All the examples below use `docker compose` (or `docker-compose` in older versions) to manage multi-container setups.

### Docker Swarm

For production deployments requiring high availability and scaling, you can use Docker Swarm mode.
Docker Swarm provides native clustering capabilities for Docker containers, allowing you to:

- Deploy services across multiple nodes
- Scale services up or down
- Manage rolling updates
- Provide service discovery and load balancing

To use Docker Swarm with Plone, you can convert `docker-compose.yml` files to Docker Swarm stack files.
The basic structure remains similar, but you may need to adjust networking and volume configurations for multi-node deployments.

```{seealso}
For more information about production orchestration with Docker Swarm, see {doc}`/deployment/orchestration`.
```

### Other orchestration tools

Plone 6 container images are OCI-compliant and can be used with other orchestration platforms:

- **Kubernetes**: For large-scale, production deployments with advanced features like auto-scaling, self-healing, and service mesh integration
- **Podman Compose**: An alternative to Docker Compose that works with Podman
- **Nomad**: HashiCorp's container orchestration platform

The examples provided here focus on Docker Compose, but the concepts can be adapted to other orchestration tools.

## Example configurations

Examples of projects running Plone using `docker compose`:

| Project example | Description |
| --- | --- |
Expand Down
80 changes: 80 additions & 0 deletions docs/install/containers/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
myst:
html_meta:
"description": "How to get started with Plone 6 containers"
"property=og:description": "How to get started with Plone 6 containers"
"property=og:title": "Getting started with containers"
"keywords": "Plone 6, install, installation, Docker, containers, getting started"
---

(install-containers-getting-started-label)=

# Getting started with containers

```{note}
Although there are many container engine tools for developing, managing, and running containers, we will use {term}`Docker` in this documentation.
```


(install-containers-index-system-requirements-label)=

## System requirements

The system requirements include those required by Docker itself.

- [Linux](https://docs.docker.com/desktop/setup/install/linux/)
- [macOS](https://docs.docker.com/desktop/setup/install/mac-install/)
- [Windows](https://docs.docker.com/desktop/setup/install/windows-install/)

Plone 6 itself requires memory and disk space in addition to those of Docker alone.
See its {ref}`create-project-cookieplone-hardware-requirements-label`.


## Install Docker

Install [Docker Desktop](https://docs.docker.com/get-started/get-docker/) for your operating system.

Docker Desktop includes all Docker tools.
{term}`Docker Compose` is one of the Docker tools that will be used in much of this documentation.


## Start Plone

First start the Plone Backend, naming it `plone6-backend` and creating a site with its default configuration, using the following command.

```shell
docker run --name plone6-backend -e SITE=Plone -d -p 8080:8080 plone/plone-backend:{PLONE_BACKEND_MINOR_VERSION}
```

Now start the Plone Frontend, linking it to the `plone6-backend`:

```shell
docker run --name plone6-frontend --link plone6-backend:backend -e RAZZLE_DEV_PROXY_API_PATH=http://backend:8080/Plone -d -p 3000:3000 plone/plone-frontend:latest
```


## Access your Plone site

Point your browser to `http://localhost:3000` and you should see the new Plone site.

```{note}
The default user is `admin` and the password is `admin`.
```


## Shutdown and cleanup

To stop and clean up the containers use the following commands.

```shell
docker stop plone6-frontend && docker rm plone6-frontend
docker stop plone6-backend && docker rm plone6-backend
```


## Next steps

Get to know the [Official Images](images/index) maintained by the Plone community.

Also see some [examples](examples/index) of how to use the Official Images to bootstrap your projects.

128 changes: 128 additions & 0 deletions docs/install/containers/images/backend-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
myst:
html_meta:
"description": "Reference for plone/plone-backend image environment variables"
"property=og:description": "Reference for plone/plone-backend image environment variables"
"property=og:title": "Plone Backend image - Environment Variables Reference"
"keywords": "Plone 6, install, installation, docker, containers, backend, plone/plone-backend, reference, environment variables"
---

# `plone/plone-backend` - Environment Variables Reference

This reference document covers all environment variables available for the Plone backend [Docker](https://www.docker.com/) image.

For usage instructions and examples, see {doc}`backend`.


## Main variables

| 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` |
| `LISTEN_PORT` | (no equivalent) | `8080` |

### Listen port

By default, the Zope process inside the container will listen on TCP port 8080.
In certain circumstances — Kubernetes or Podman pods — there may be a need to run
more than one Zope process within the network namespace, which would result in
listen port clashes as two different processes within the same namespace attempt
to listen to the same TCP port.

In these cases, the variable `LISTEN_PORT` can be set to any particular port above
1024 to ensure that the container will listen on the desired port.


## Site creation variables

| Environment variable | Description |
| --- | --- |
| `SITE` | Id of the site to be created, for example, `Plone` |
| `TYPE` | Type of the site, either `classic` or `volto`. Default: `volto` |
| `PROFILES` | Initialize site with additional profiles, for example, `eea.api.layout:default` |
| `DELETE_EXISTING` | Force site to be recreated if it already exists, for example, `true` |


## ZOPE variables

| Environment variable | Description | Default value |
| --- | --- | --- |
| `ZODB_CACHE_SIZE` | database cache size | `50000` |


## ZEO variables

| Environment variable | Description | ZEO option | Default value |
| --- | --- | --- | --- |
| `ZEO_ADDRESS` | URL of the ZEO interface, `host:port` | | |
| `ZEO_SHARED_BLOB_DIR` | ZEO option |`name` | `off` |
| `ZEO_READ_ONLY` | ZEO option |`read-only` | `false` |
| `ZEO_CLIENT_READ_ONLY_FALLBACK` | ZEO option |`read-only-fallback` | `false` |
| `ZEO_STORAGE` | ZEO option |`storage` | `1` |
| `ZEO_CLIENT_CACHE_SIZE` | ZEO option | `cache-size` | `128MB` |
| `ZEO_DROP_CACHE_RATHER_VERIFY` | ZEO option | `drop-cache-rather-verify` | `false` |


## Relational Database variables

| Environment variable | Description | RelStorage option | Default value |
| --- | --- | --- | --- |
| `RELSTORAGE_DSN` | {ref}`containers-images-backend-postgresql-dsn-label` for the database interface | | |
| `RELSTORAGE_NAME` | RelStorage option | `name` | `storage` |
| `RELSTORAGE_READ_ONLY` | RelStorage option | `read-only` | `off` |
| `RELSTORAGE_KEEP_HISTORY` | RelStorage option | `keep-history` | `true` |
| `RELSTORAGE_COMMIT_LOCK_TIMEOUT` | RelStorage option | `commit-lock-timeout` | `30` |
| `RELSTORAGE_CREATE_SCHEMA` | RelStorage option | `create-schema` | `true` |
| `RELSTORAGE_SHARED_BLOB_DIR` | RelStorage option | `shared-blob-dir` | `false` |
| `RELSTORAGE_BLOB_CACHE_SIZE` | RelStorage option | `blob-cache-size` | `100mb` |
| `RELSTORAGE_BLOB_CACHE_SIZE_CHECK` | RelStorage option | `blob-cache-size-check` | `10` |
| `RELSTORAGE_BLOB_CACHE_SIZE_CHECK_EXTERNAL` | RelStorage option | `blob-cache-size-check-external` | `false` |
| `RELSTORAGE_BLOB_CHUNK_SIZE` | RelStorage option | `blob-chunk-size` | `1048576` |
| `RELSTORAGE_CACHE_LOCAL_MB` | RelStorage option | `cache-local-mb` | `10` |
| `RELSTORAGE_CACHE_LOCAL_OBJECT_MAX` | RelStorage option | `cache-local-object-max` | `16384` |
| `RELSTORAGE_CACHE_LOCAL_COMPRESSION` | RelStorage option | `cache-local-compression` | `none` |
| `RELSTORAGE_CACHE_DELTA_SIZE_LIMIT` | RelStorage option | `cache-delta-size-limit` | `100000` |

```{note}
Currently this image supports only the configuration of a PostgreSQL backend via configuration variables.
If you need to use MySQL or Oracle, we recommend that you extend this image and overwrite the `/app/etc/relstorage.conf` file.
```

(containers-images-backend-postgresql-dsn-label)=

### PostgreSQL DSN

A valid PostgreSQL DSN is a list of parameters separated with whitespace.
A typical DSN looks like the following:

```console
dbname='zodb' user='username' host='localhost' password='pass'
```


## CORS variables

| Environment variable | Description | Default value |
| --- | --- | --- |
| `CORS_ALLOW_ORIGIN` | Origins that are allowed access to the resource. Either a comma separated list of origins, for example `http://example.net,http://mydomain.com` or `*` | `http://localhost:3000,http://127.0.0.1:3000` |
| `CORS_ALLOW_METHODS` | A comma separated list of HTTP method names that are allowed by this CORS policy, for example `DELETE,GET,OPTIONS,PATCH,POST,PUT` | `DELETE,GET,OPTIONS,PATCH,POST,PUT` |
| `CORS_ALLOW_CREDENTIALS` | Indicates whether the resource supports user credentials in the request | `true` |
| `CORS_EXPOSE_HEADERS` | A comma separated list of response headers clients can access, for example `Content-Length,X-My-Header` | `Content-Length,X-My-Header` |
| `CORS_ALLOW_HEADERS` | A comma separated list of request headers allowed to be sent by the client, for example `X-My-Header` | `Accept,Authorization,Content-Type,X-Custom-Header` |
| `CORS_MAX_AGE` | Indicates how long the results of a preflight request can be cached | `3600` |

These variables are used to configure [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS).

(containers-images-backend-add-ons-label)=

## Add-on variables

| Environment variable | Description | Details |
| --- | --- | --- |
| `ADDONS` | A space separated list of python libraries to install | {ref}`containers-images-backend-add-ons-label` |
| `DEVELOP` | A space separated list of python libraries to install in editable mode | See {ref}`containers-images-backend-add-ons-label` |
| `PIP_PARAMS` | Parameters used in `pip` installation commands | [`pip install`](https://pip.pypa.io/en/stable/cli/pip_install/) |

Loading