Website for The Sanctuary For Independent Media
This is a WordPress site, the theme mediasanctuary
and the plugins it depends on are managed here.
Start the Docker containers and the asset watcher:
./bin/start
Once it's running, load the website at localhost:8080.
Exiting the start
script (ctrl-C) stops the containers.
Before you can sync content from dev.mediasanctuary.org
to your local dev site, you will need to make sure your public SSH key is setup on the devmediasan
account. Then you can use the following command:
./bin/sync
That script does the following:
- Export the database
- Replace URLs in the SQL file
- Edit the SQL to remove all the WordPress user accounts and revision posts
- Edit the SQL to a new WordPress account
dev
with passworddev
- Import that SQL file into your local database
- rsync the uploads directory
After you finish, your local environment should look pretty much the same as dev.mediasanctuary.org, but you should login with username/password: dev
/dev
.
Rebuild the container if necessary:
docker compose build
Tail the logs:
docker compose logs -f web
Login to a shell on the web server container:
docker compose exec web bash
The Dockerfile
uses the official wordpress
image, which in turn is built off of php
. The web
container uses Debian-style package management. We don't modify it very much, just installing some tools like WP-CLI.
There won't be any database tables setup first time you run the container, but you can install the site by visiting localhost:8080.
You can connect to the MySQL database on port 3307.
We use WP-CLI to keep the plugin files up-to-date, and commit the changes to source control. Note that updates to the Advanced Custom Fields plugin require that you configure it with a license key.
How to upgrade the plugins:
docker compose exec web wp plugin upgrade --all
To update your local WordPress dev instance:
docker compose exec web wp core upgrade
Updating WordPress on the dev or prod servers requires that you SSH in and run wp core upgrade
on the server.
Plugin files are stored in source control. The way to install a new one is to install it locally, commit the files, then update the servers.
docker compose exec web wp plugin install [new plugin]
We use GitHub Actions to deploy updates to the servers.
- Commits to the
main
branch end up getting deployed tohttps://dev.mediasanctuary.org/
- Commits to the
production
branch end up getting deployed tohttps://www.mediasanctuary.org/