Add some deployment documentation

Ref #13
This commit is contained in:
3wc 2021-12-17 13:01:19 +02:00
parent e59daa1c28
commit 93402767b7

View File

@ -2,24 +2,61 @@
A template for a Wordpress site using Bedrock (Composer) + Docker.
Based on [`autonomic-cooperative/wordpress-docker-composer`](https://git.autonomic.zone/autonomic-cooperative/wordpress-docker-composer)
NB.
* If you import a database from a live site, you will have to change the upload path (in Settings->Media) to `/app/web/app/uploads`
* Debug log is here: `./src/web/app/debug.log`
Based on
[`autonomic-cooperative/wordpress-docker-composer`](https://git.autonomic.zone/autonomic-cooperative/wordpress-docker-composer)
and
[`autonomic-cooperative/wordpress-nginx-docker`](https://git.autonomic.zone/autonomic-cooperative/wordpress-nginx-docker).
## Quick start
1. Create a new repository in Gitea, using this repository as a template
2. Clone the new repository
3. Copy `src/.env.example` to `src/.env`
4. Run `docker-compose up`
1. Install Docker, docker-compose, and git
2. Create a new repository in Gitea, using this repository as a template
3. Clone the new repository
4. Copy `src/.env.example` to `src/.env`
5. Run `docker-compose up`
You should now be able to access the local site on http://localhost
## Development
### Debugging
Set `WP_ENV=development` in `src/.env` to enable debugging output and the debug
log, and enable plugin and theme installation via the dashboard.
The debug log is located:
- outside containers: `./src/web/app/debug.log`
- inside containers: `/app/web/app/debug.log`
### Importing a database dump
Assuming you have `dump.sql.gz` in the current directory:
`zcat dump.sql.gz | docker-compose exec -T db mysql -u wordpress -pwordpress wordpress`
Post-restore steps:
* If **the upload path** was set in the database, you will need to change it (in
Settings → Media) to `/app/web/app/uploads`
* If the site you're loading used a **non-standard database table prefix** (i.e.
not `wp`), you'll need to specify it as `DB_PREFIX` in `src/.env`.
## Deployment
### Initial set-up
Our recommended production deployment set-up is:
- Web server: Nginx (ease of configuration vs. Apache, nobody seems to be using
other web servers for Wordpress)
- PHP: PHP-FPM (better performance and security than mod_php)
- Database: MariaDB (flipped a coin between that and MySQL..)
- Auto-deployment: Drone (Autonomic standard)
- Updates: renovate-bot (Autonomic standard)
- Orchestration: Docker "swarm mode" / Co-op Cloud (Autonomic standard, also
standardises backups and SSL, and makes it easier to migrate between servers)
- Host operating system: Debian (but others should work too)
- Server provisioning: Our [autonomic-cooperative/infrastructure Ansible
playbooks](https://git.autonomic.zone/autonomic-cooperative/infrastructure/)
### Auto-deployment