Deploying the Project#
This guide outlines the steps to deploy the project using a Docker stack comprising:
Traefik: A router and SSL termination tool, integrated with Let's Encrypt for complimentary SSL certificates.
Plone Frontend using Volto: A service based on React for the frontend.
Plone Backend: The API service.
Postgres 14 Database: Handles data persistence.
You can find this stack at
devops/stacks/<url>.yml. It's modular, allowing easy integration of additional services like Varnish,
Building Docker Images#
Ensure you build the Docker images for the Frontend and Backend servers before deployment. GitHub Actions, configured in
.github/workflows/frontend.yml, facilitate this process.
Before deploying, push all code changes and ensure GitHub Actions successfully complete their runs. Execute these commands to format the code and run tests:
Manual Deployment with
devops/Makefile for manual deployment.
Deploying the Stack#
Execute the following command to deploy the stack defined in
devops/stacks/<url>.yml to the remote server:
Verifying Stack Status#
To check the status of all services in your stack, run:
Creating Plone Site#
On the initial deployment, the frontend containers might be unhealthy due to the unconfigured Plone site on the backend. Create a new site with:
Monitor the logs of each service with these commands:
Automating Deployment with GitHub Actions#
cookiecutter-plone-starter includes a GitHub Actions Workflow, located at
.github/workflows/manual_deploy.yml, enabling deployment directly from the GitHub UI.
Creating a New Environment#
Log in to GitHub.
Navigate to the project repository.
Name it after your public URL and configure the environment.
Adding Environment Secrets#
Add secrets in the
Secrets section of your environment. Refer to the table below:
Your hostname or IP
The Docker Swarm manager’s address.
The SSHD port.
A user with Docker command permissions.
The private SSH key for connection.
File containing environment variables for the stack file.
Adding Repository Variables#
Secrets and Variables >
Variables, add the repository variable:
The name of the earlier created environment
This variable is referenced in
Initiating Manual Deployment#
Ensure both Backend and Frontend tests are successful and images for both servers are available.
Go to the project's repository on GitHub.
Find Manual Deployment... and click
Branch: mainunder Use workflow from.
The workflow connects to DEPLOY_HOST using DEPLOY_USER and DEPLOY_SSH key, initiates a new deployment using the specified stack, and provides a detailed deployment report.
Accessing the Site#
Your site should now be accessible via the defined public URL.
Note: Ensure to replace placeholders like
<url> with actual values as per your project's specifics. Also, ensure that the paths to files and directories are correct and exist in your project structure.