You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/plone-deployment/deploy.md
+18-22Lines changed: 18 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ This guide outlines the steps to deploy the project using a Docker stack compris
18
18
-**Plone Backend:** The API service.
19
19
-**Postgres 14 Database:** Handles data persistence.
20
20
21
-
You can find this stack at {file}`devops/stacks/ploneconf2024-<your-github-username>.tangrama.com.br.yml`. It's modular, allowing easy integration of additional services like {term}`Varnish`, `Solr`, or `ElasticSearch`.
21
+
You can find this stack at {file}`devops/stacks/ploneconf2025-<your-github-username>.tangrama.com.br.yml`. It's modular, allowing easy integration of additional services like {term}`Varnish`, `Solr`, or `ElasticSearch`.
22
22
23
23
```{seealso}
24
24
[Traefik Proxy with HTTPS](https://dockerswarm.rocks/traefik/)
@@ -27,7 +27,7 @@ You can find this stack at {file}`devops/stacks/ploneconf2024-<your-github-usern
27
27
## Building Docker Images
28
28
29
29
Ensure you build the Docker images for the Frontend and Backend servers before deployment.
30
-
GitHub Actions, configured in {file}`.github/workflows/backend.yml` and {file}`.github/workflows/frontend.yml`, facilitate this process.
30
+
GitHub Actions, configured in {file}`.github/workflows/main.yml`, facilitate this process.
31
31
32
32
````{important}
33
33
Before deploying, run the following commands from your project's root directory to format the code and run tests.
@@ -56,43 +56,48 @@ Watch Usage
56
56
After these commands succeed, commit all code changes, push to GitHub, and ensure all GitHub Actions successfully complete their runs.
57
57
````
58
58
59
-
60
-
## Manual Deployment with `devops/Makefile`
59
+
## Manual Deployment with Ansible
61
60
62
61
Utilize the {file}`Makefile` at {file}`devops/Makefile` for manual deployment.
63
62
64
63
### Deploying the Stack
65
64
66
-
Execute the following command from your project's {file}`devops` directory to deploy the stack defined in {file}`devops/stacks/ploneconf2024-<your-github-username>.tangrama.com.br.yml` to the remote server.
65
+
Execute the following command from your project's {file}`devops/ansible` directory to deploy the stack defined in {file}`devops/stacks/ploneconf2025-<your-github-username>.tangrama.com.br.yml` to the remote server.
67
66
68
67
```shell
69
-
make stack-deploy
68
+
uv run ansible-playbook playbooks/deploy.yml --tags project
70
69
```
71
70
72
71
### Verifying Stack Status
73
72
74
-
To check the status of all services in your stack, run:
73
+
To check the status of all services in your stack, access the remote server:
Copy file name to clipboardExpand all lines: docs/plone-deployment/intro.md
+22-13Lines changed: 22 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,8 @@ myst:
9
9
10
10
# Introduction
11
11
12
-
This training material provides insights into deploying Plone for production.
13
-
We aim to impart skills for automating deployment processes,
14
-
ensuring that you can transform a fresh Linux server into an efficient and robust Plone server.
12
+
This training provides practical guidance for deploying Plone in production.
13
+
It focuses on automating deployments so you can reliably transform a fresh Linux server into a production-ready Plone instance.
15
14
16
15
## Target Audience
17
16
@@ -20,17 +19,29 @@ or considering a virtual machine on your personal computer for testing, this tra
20
19
21
20
## Objectives
22
21
22
+
- Describe the lifecycle of a Plone project.
23
23
- Achieve repeatable deployments.
24
24
- Ensure consistency across multiple deployment instances.
25
25
- Impart knowledge on the tools reflecting the Plone community's preferences.
26
26
27
-
## Training Content
27
+
## Different types of Plone codebases
28
28
29
-
We will delve into a basic setup, scalable to accommodate extensive Plone installations.
29
+
In the Plone ecosystem there are three common codebase types:
30
+
31
+
| Type | Definition | Example |
32
+
| -- | -- | -- |
33
+
| Distribution | An opinionated packaging of Plone, usually focused on a vertical market or specific use case. | kitconcept Intranet, Quaive, ioCommune |
34
+
| Add-On | A package (or group of packages) that extends Plone with new features. | EEA Accordion, Volto Form Support, Volto Light Theme, Collective Tech Event |
35
+
| Project | A specific implementation of Plone (or a Plone-based distribution) used to create a site, intranet, or knowledge base. | Plone Conference Site, Plone.org, DLR.de |
36
+
37
+
Add-ons are typically tested against a matrix of supported versions: backend add-ons against multiple Python and Plone versions, and frontend add-ons against Node and Volto version matrices. Distributions are released with a narrower, opinionated set of pinned dependencies to reduce integration complexity.
38
+
39
+
Project codebases generally require strict repeatability and therefore pin exact dependency versions.
40
+
For projects managed with `zc.buildout`, it has been best practice to include a `versions.cfg` file that controls package versions. In this training we follow the same principle: we use a backend lockfile ( `uv.lock`) and `pnpm-lock.yaml` for the frontend.
30
41
31
42
(deployment-training-choices)=
32
43
33
-
### Training Choices
44
+
### Training choices
34
45
35
46
#### Linux
36
47
@@ -39,21 +50,19 @@ However, any system capable of running Python should suffice for development pur
39
50
40
51
#### Major Distributions
41
52
42
-
We support and recommend Ubuntu LTS for server setup. Debian and other distributions with up-to-date packages are also compatible.
53
+
We recommend Ubuntu LTS for server deployments. Debian and other stable distributions with up-to-date packages are also supported.
43
54
44
55
#### Platform Packages
45
56
46
-
Prioritize platform packages to leverage automatic updates. Opt for usability over the latest versions to ensure stability and security.
57
+
Prefer using distribution-packaged system packages where practical to benefit from automatic security updates and easier maintenance. Favor stability and maintainability over running the absolute latest upstream versions on production systems.
47
58
48
59
#### Ansible
49
60
50
-
Ansible stands out for its serverless nature, Python foundation, and user-friendly YAML configuration language,
51
-
making it a preferred choice for deployment automation.
61
+
Ansible is a natural fit for our automation needs: it's agentless, written in Python, and uses readable YAML playbooks. Its idempotent design and role-based structure make it a good choice for repeatable server provisioning.
52
62
53
63
#### Docker and Docker Swarm
54
64
55
-
Embrace the consistency and repeatability offered by containers. Docker, complemented by Docker Swarm,
56
-
simplifies the setup process, making it accessible even for beginners.
65
+
Containers provide consistency and repeatability. Docker (and Docker Compose for local orchestration) is used throughout this training; Docker Swarm is the recommended option for lightweight orchestration in production scenarios covered here.
57
66
58
67
#### GitHub and GitHub Actions
59
68
@@ -62,4 +71,4 @@ The principles outlined are adaptable to GitLab, Jenkins, and similar platforms.
62
71
63
72
#### Kubernetes
64
73
65
-
While the current training edition doesn't cover Kubernetes, we anticipate its inclusion in future updates.
74
+
This edition of the training does not cover Kubernetes, but we expect to include Kubernetes-based deployment patterns in a future update. The Plone community maintains Helm charts that can be used as a starting point: https://github.com/plone/helm-charts
Copy file name to clipboardExpand all lines: docs/plone-deployment/plone-docker-images.md
+86-8Lines changed: 86 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,15 +9,15 @@ myst:
9
9
10
10
# Plone Docker Images
11
11
12
-
Since the release of Plone 6, the community has a new set of Docker images offering more base options.
12
+
Since the release of Plone 6, the community has a new set of public Docker images offering most base options, and documenting the configuration. They are meant as a way to quickly start a project, and provide inspiration for your own projects advanced requirements.
13
13
14
14
## `plone/plone-frontend`
15
15
16
-
Repository available at https://github.com/plone/plone-frontend/.
16
+
Repository is available at https://github.com/plone/plone-frontend/.
17
17
18
18
Installs the Plone 6 user-experience using the React-powered frontend, Volto.
19
19
20
-
Should be used to showcase the Plone 6 experience, as new projects will probably implement their own Docker images (with a similar Dockerfile), like the one below:
20
+
Should be used to showcase the Plone 6 experience, and how to build images in multiple stages to reduce image size. New projects will probably implement their own Docker images (with a similar Dockerfile), like the one below:
21
21
22
22
```Dockerfile
23
23
# syntax=docker/dockerfile:1
@@ -58,10 +58,11 @@ EOT
58
58
59
59
Repository available at https://github.com/plone/plone-backend/.
60
60
61
-
Installs the Plone 6 backend using a pip-based installation.
62
-
This approach makes it easier and faster to extend this image in your own project.
61
+
Installs the Plone 6 backend using a package-based installation.
63
62
64
-
One example of such extension would be:
63
+
There are currently two distinct approaches to use the backend base images in your project:
64
+
65
+
### Usage with `pip` + `mxdev`
65
66
66
67
```Dockerfile
67
68
# syntax=docker/dockerfile:1
@@ -93,7 +94,7 @@ EOT
93
94
FROM plone/server-prod-config:${PLONE_VERSION}
94
95
95
96
LABEL maintainer="Plone Community <collective@plone.org>" \
org.label-schema.description="Plone Conference Training Backend." \
98
99
org.label-schema.vendor="Plone Community"
99
100
@@ -106,8 +107,85 @@ RUN <<EOT
106
107
EOT
107
108
```
108
109
110
+
### Usage with `uv` (Experimental)
111
+
112
+
To use these images, your project should be already using `uv` and have a `pyproject.toml` section with additional dependencies to be installed inside a container:
113
+
114
+
```toml
115
+
[dependency-groups]
116
+
...
117
+
container = [
118
+
"plone.app.upgrade",
119
+
"psycopg2==2.9.10",
120
+
"relstorage==4.1.1",
121
+
"zeo==6.0.0",
122
+
]
123
+
```
124
+
125
+
The `Dockerfile` will look like:
126
+
127
+
```Dockerfile
128
+
# syntax=docker/dockerfile:1.9
129
+
ARG PYTHON_VERSION=3.12
130
+
FROM plone/server-builder:uv-${PYTHON_VERSION} AS builder
org.label-schema.description="Plone Conference Training Backend." \
174
+
org.label-schema.vendor="Plone Community"
175
+
176
+
# Copy the pre-built `/app` directory to the runtime container
177
+
# and change the ownership to user app and group app in one step.
178
+
COPY --from=builder --chown=500:500 /app /app
179
+
180
+
RUN <<EOT
181
+
ln -s /data /app/var
182
+
chown -R 500:500 /data
183
+
EOT
184
+
```
185
+
186
+
109
187
## `plone/plone-zeo`
110
188
111
189
Repository available at https://github.com/plone/plone-zeo/.
112
190
113
-
Installs a ZEO database server.
191
+
Provides a ZEO database server for your container based Plone CMS Stack. This allows you to scale to multiple backends without a relational Database like PostgreSQL or MySQL to store the content data.
Copy file name to clipboardExpand all lines: docs/plone-deployment/plone-stack.md
+20-7Lines changed: 20 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ myst:
10
10
11
11
Explore the intricate components of the Plone stack, tailored for deploying a modern Plone 6 site with a ReactJS-powered frontend.
12
12
For deployments focusing on Plone Classic UI with server-side HTML rendering, the frontend component is excluded.
13
-
This guide won't cover the integration of a web accelerator or the setup of an edge caching service.
13
+
This guide won't explain all the details regarding the integration of a web accelerator or the setup of an edge caching service.
14
14
15
15
## Components of the Plone Stack
16
16
@@ -26,15 +26,22 @@ To understand the rewrite rules used in Traefik, please read our reference about
26
26
27
27
### Plone Frontend
28
28
29
-
Hosted on a Node.js HTTP-server running on port 3000, the Plone frontend constitutes the default user interfaceand requires access to the Plone Backend and the web server.
29
+
Hosted on a Node.js HTTP-server running on port 3000, the Plone frontend constitutes the default user interface. It serves a sever side rendered html version of the webpage and delivers the javascript bundles for the dynamic web application runnin gin the browser. It requires access to the Plone Backend and is exposed through the webserver and Accelerator.
30
30
31
31
### Plone Backend
32
32
33
-
Operating on port 8080, the Plone Backend, a WSGI process, serves as the HTTP server hosting the Plone API. It's optimal to pair it with a specialized database like ZEO server or a relational database via RelStorage, supporting PostgreSQL, MySQL/MariaDB, and Oracle. A separate shared file system is essential for storing binary data if ZEO is employed.
33
+
Operating on port 8080, the Plone Backend, Python WSGI process, serves as the Application server hosting the Plone REST API. It delivers the content to the frontend Server and Browsers, stores it persistently in a backendd database or on filesystrem, and provides management API and security, like moving/copying content, advanced worfklows, security, etc.
34
+
35
+
It's optimal to pair it with a specialized database like ZEO server or a relational database
34
36
35
37
### Database
36
38
37
-
The database layer can range from a simple ZODB with file storage to more scalable options like a ZEO server or a relational database. This training will focus on using a PostgreSQL instance.
39
+
The database layer can range from a simple ZODB with file storage to more scalable options like a ZEO server or a relational database via RelStorage, supporting PostgreSQL, MySQL/MariaDB, and Oracle. In the most simple version, the Plone backend can open a database on the local filesystem. But in this setup you are limited to only one backend. If you use ZEO, multiple Plone backends open a connection to the ZEO server, which manages the ZODB files. A separate shared file system like NFS is essential for storing binary data and sharing it to the backends with a ZEO setup.
40
+
41
+
This training will focus on using a PostgreSQL instance. With a relational database, the backends connect through the RelStorage Adapter to the Database, where the ZODB is mapped in a very basic way to a number of specialised tables and fields to hold all data.
42
+
43
+
Storing binary data (blobs) in a relational database or keeping them seperate in a blob storage is an advanced discussion and has different trade offs when looking at
44
+
performance and high availability.
38
45
39
46
## Deployment Configurations
40
47
@@ -70,10 +77,10 @@ Web server → Web Accelerator → Plone Frontend → Plone Backend → Database
70
77
71
78
In a multi-server environment, load distribution and redundancy are achieved through various configurations, enabling horizontal scaling.
72
79
73
-
```{figure} _static/request_flow.png
74
-
:alt: Flow of a request to `https://example.com`
80
+
```{figure} _static/request_flow.svg
81
+
:alt: Flow of a request to `https://plone.example.com`
75
82
76
-
Flow of a request to https://example.com
83
+
Flow of a request to https://plone.example.com
77
84
```
78
85
79
86
#### Web server and Web Accelerator Layer
@@ -88,3 +95,9 @@ Hosts scalable Plone Frontend and Backend processes, enhancing performance and r
88
95
89
96
Can host a ZEO server or a relational database. Managed relational database services with backup and replication are
90
97
recommended for those unfamiliar with database management, with PostgreSQL being a preferred choice.
98
+
99
+
### Scaling and High Availability
100
+
101
+
The components of the CMS Stack as described above, can all run in a parallelized, distributed, and optionally high available setup. There are however extra requirements for some of the building blocks. The ingress web server (Traefik) can run multiple instances, but needs a way to sync TLS certificates and route information. The Varnish server can be run multiple times, but purge requests for changed/stale contenct, will need to be multiplied to all cache instances.
102
+
103
+
The Plone frontend and backend servers can and should run with multiple instances in a larger setup to offer enough throughput. Lastly, the database should be dimensioned large enough to support al storage/retrieve requests from the Backends. When high availability is required, the database layer should be set up with Relstorage and a Relational Database that is configured accordingly (for example primary/secondary with active failover, or a a three node DB cluster).
0 commit comments