Local Setup¶
This guide walks you through running the project locally using Docker.
Prerequisites¶
- Docker Desktop (with Compose v2)
- mkcert for local SSL certificates
- Composer (for installing PHP dependencies inside the container or locally)
- Git (with access to the private Bitbucket/GitHub repositories and submodules)
1. Clone with submodules¶
git clone --recurse-submodules git@github.com:subscribed-aps/barberklingen-nl-bedrock.git
cd barberklingen-nl-bedrock
If you already cloned without submodules:
2. Set up environment files¶
Copy the example env file and fill in your local values:
Key values to set for local development:
PROJECT_ENV=local
WP_HOME=https://barberklingen.nl-local
WP_SITEURL=https://barberklingen.nl-local/wp
See Environment Variables for a full reference.
3. Set up local Docker config¶
Copy the example local devops config:
This directory contains Nginx, PHP, and MySQL configs tuned for local use. You can customise them without affecting other environments.
4. Generate SSL certificates¶
The generated .pem files are referenced by the Nginx config in devops/local/nginx/default.conf.
5. Set up Docker Compose override¶
The override file mounts the site/ directory directly as current so code changes are reflected immediately without a deployment cycle.
6. Install Composer dependencies¶
Note: You need access to the private Composer registry at
packagist.barberklingen.dkand to Elementor's Composer repo. Make sure your credentials are configured in~/.composer/auth.json.
7. Start the containers¶
This starts: - php — PHP-FPM container - nginx — serves the site over HTTPS - redis — object cache - mariadb — database (added via the override file)
8. Import a database¶
Use WP-CLI or a direct MySQL import to load a database dump:
# Via WP-CLI inside the PHP container
docker compose exec php wp db import /path/to/dump.sql --path=/var/www/barberklingen/current/web/wp
# Or via mysql client
docker compose exec mariadb mysql -u barberklingen -pbarberklingen barberklingen < dump.sql
9. Update the site URL (if importing from production)¶
docker compose exec php wp search-replace 'https://www.barberklingen.nl' 'https://barberklingen.nl-local' \
--path=/var/www/barberklingen/current/web/wp --allow-root
Useful WP-CLI commands¶
# Run a WP-CLI command inside the PHP container
docker compose exec php wp <command> --path=/var/www/barberklingen/current/web/wp
# Flush object cache
docker compose exec php wp cache flush --path=/var/www/barberklingen/current/web/wp
# Run database migrations
docker compose exec php wp barberklingen database migrate --path=/var/www/barberklingen/current/web/wp