|
| 1 | +--- |
| 2 | +html_meta: |
| 3 | + "description": "Simple Plone 6 setup with scalable backend and data being persisted in a Zeo volume." |
| 4 | + "property=og:description": "Simple Plone 6 setup with scalable backend and data being persisted in a Zeo volume." |
| 5 | + "property=og:title": "HAproxy, Backend, ZEO container example" |
| 6 | + "keywords": "Plone 6, Container, Docker, HAproxy, Zeo" |
| 7 | +--- |
| 8 | + |
| 9 | +# Haproxy, Backend, ZEO container example |
| 10 | + |
| 11 | +Very simple setup with only one or more backend instances accessing a ZEO server and data being persisted in a Docker volume. |
| 12 | + |
| 13 | +## Setup |
| 14 | + |
| 15 | +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. |
| 16 | +HAProxy is used for load balancing in this example. |
| 17 | + |
| 18 | +```yaml |
| 19 | +version: "3" |
| 20 | +services: |
| 21 | + |
| 22 | + lb: |
| 23 | + image: plone/plone-haproxy |
| 24 | + depends_on: |
| 25 | + - backend |
| 26 | + ports: |
| 27 | + - "8080:8080" |
| 28 | + - "1936:1936" |
| 29 | + environment: |
| 30 | + FRONTEND_PORT: "8080" |
| 31 | + BACKENDS: "backend" |
| 32 | + BACKENDS_PORT: "8080" |
| 33 | + DNS_ENABLED: "True" |
| 34 | + HTTPCHK: "GET /" |
| 35 | + INTER: "5s" |
| 36 | + LOG_LEVEL: "info" |
| 37 | + |
| 38 | + backend: |
| 39 | + image: plone/plone-backend:6.0.0a4 |
| 40 | + restart: always |
| 41 | + environment: |
| 42 | + ZEO_ADDRESS: zeo:8100 |
| 43 | + ports: |
| 44 | + - "8080" |
| 45 | + depends_on: |
| 46 | + - zeo |
| 47 | + |
| 48 | + zeo: |
| 49 | + image: plone/plone-zeo:latest |
| 50 | + restart: always |
| 51 | + volumes: |
| 52 | + - data:/data |
| 53 | + ports: |
| 54 | + - "8100" |
| 55 | + |
| 56 | +volumes: |
| 57 | + data: {} |
| 58 | +``` |
| 59 | +
|
| 60 | +## Build the project with multiple backends |
| 61 | +
|
| 62 | +Run `docker-compose up -d --scale backend=4` from your project directory. |
| 63 | + |
| 64 | +## Access Plone via Browser |
| 65 | + |
| 66 | +Point your browser at `http://localhost:8080`, using the username and password combination of `admin` and `admin`, and you should see the default Plone site creation page. |
| 67 | + |
| 68 | +## Access HAProxy Stats Page via Browser |
| 69 | + |
| 70 | +Point your browser at `http://localhost:1936`, using the username and password combination of `admin` and `admin`, and you should see HAProxy statistics for your Plone cluster. |
| 71 | + |
| 72 | +## Shutdown and cleanup |
| 73 | + |
| 74 | +The command `docker-compose down` removes the containers and default network, but preserves the Plone database. |
| 75 | + |
| 76 | +The command `docker-compose down --volumes` removes the containers, default network, and the Plone database. |
0 commit comments