Local WordPress stack (Docker Compose) with wp-cli auto-install and GCA Intranet themes.
This repo also includes an AWS-friendly WordPress container build for deployment to EC2 / ECS-style environments.
- WordPress runs from the official WordPress Docker image
- WordPress core is not committed to Git
Custom themes and plugins live under:
wp-content/themes/gca-intranet-foundation(parent theme)wp-content/themes/gca-intranet(child theme)wp-content/plugins/gca-custom
Note: The entire local ./wp-content folder is bind-mounted to the container locally. If you install a new plugin via the WordPress Admin GUI, it will sync to your local machine so it can be committed to Git.
- MySQL 8.0 for local development (via Docker Compose)
A wp-cli container handles the one-time WordPress setup:
- Creates
wp-config.php - Installs WordPress
- Activates the GCA theme
- Sets permalinks
A Dockerfile is included for AWS container platforms.
In AWS you would typically use RDS MySQL.
DB credentials should be provided via environment variables or secrets.
- Docker Desktop (or Docker Engine) installed and running
- Git
- No local PHP, Node.js, or npm required (Docker handles all dependencies).
Copy the example file and adjust values if needed:
cp .env.example .envCommon values you may want to change:
WP_URLWP_PORT- Admin username / password
- Important: Ensure
WP_HOMEandWP_SITEURLexplicitly match your URL and port (e.g.,http://localhost:8090) to prevent WordPress redirect loops.
If you're on local you need to pass in the compose file to use: docker-compose.local.yml.
LOCAL build:
docker compose -f docker-compose.local.yml up -d --buildSERVER build:
docker compose --env-file .env up -d --build(Optional) Confirm services are running:
docker compose psNote: the first run can take a short while while MySQL initialises.
Run the wp-cli bootstrap container. This is safe to re-run — it will skip steps if WordPress is already installed.
docker compose --env-file .env run --rm wpcliThis will:
- Ensure WordPress core exists
- Create
wp-config.php(if missing) - Install WordPress
- Activate the GCA theme
- Set permalink structure
- Site:
http://localhost:8080(or whateverWP_PORTis set to) - Admin:
http://localhost:8080/wp-admin
Admin credentials are defined in .env:
WP_ADMIN_USERWP_ADMIN_PASSWORD
If things get into a bad state, do a full reset:
docker compose down -v
docker compose --env-file .env up -d --build
docker compose --env-file .env run --rm wpcliThis removes all local data and re-initialises WordPress.
- Themes live directly in this repo under
wp-content/themes/ - No symlinks are used
- Changes to themes should be committed to Git
- WordPress core is provided entirely by Docker
If your theme uses an npm build step for CSS/JS, use the built-in Docker container to compile assets (no local Node installation required).
To install dependencies and build once:
docker compose -f docker-compose.local.yml run --rm theme-builderTo watch for file changes during development:
docker compose -f docker-compose.local.yml run --rm theme-builder npm run watchWhether compiled assets should be committed depends on repo convention. Follow existing patterns in this repo.
Use these checks when validating header/footer changes.
-
Desktop (≥992px)
- Logo sits in the left gutter (outside the boxed container alignment)
- Boxed area: row 1 = utility links + search, row 2 = primary nav
- Dropdown chevrons appear to the right of nav items (outlined “V”)
-
Mobile (<992px)
- Row 1: logo left, utility links top-right (stacked)
- Row 2: search left, menu toggle right
- Keyboard: Tab through skip link → utility → search → nav; focus visible throughout
- Mobile menu toggle updates
aria-expanded - Dropdowns open via click and keyboard (Enter/Space)
- Set
WP_URLto the EC2 public IP or DNS name
e.g.http://<public-ip>orhttps://intranet.example.gov.uk - Set
WP_PORT=80if exposing WordPress directly
In production:
- Use RDS MySQL
- Do not use the local MySQL container
.envis local only — never commit.env- Use
.env.exampleas the template
Start Docker Desktop and retry.
- Change
WP_PORTin.env - Restart containers
WordPress relies on absolute URLs. Ensure WP_HOME and WP_SITEURL in your .env file explicitly include your custom port (e.g., http://localhost:8090). Restart the container and test in an Incognito Window to clear cached browser redirects.
Run the wp-cli bootstrap again:
docker compose --env-file .env run --rm wpcliIf still broken, do a full reset (see above).
Confirm MySQL container is running:
docker compose psCheck DB logs:
docker compose logs db