Skip to content

Local Setup

This project runs in Docker with PHP-FPM, Nginx, MariaDB, and Redis.

Prerequisites

  • Docker and Docker Compose
  • SSH access to Bitbucket (for cloning the repo and submodules)
  • SSH access to packagist.barberklingen.dk (for private Composer packages)
  • Elementor license credentials (ELEMENTOR_EMAIL + ELEMENTOR_LICENSE) for the Composer Elementor repo

Verify Docker is installed:

docker -v
docker compose version

1. Clone the repository

git clone git@bitbucket.org:barberklingen-wordpress/barberklingen-dk-bedrock.git
cd barberklingen-dk-bedrock

2. Configure environment

Copy and edit the root .env (controls Docker container names, ports, and database credentials):

cp .env.example .env

Key variables to review:

Variable Purpose
PROJECT_ENV Should be local for local development
NGINX_CONTAINER_PORT Host port for HTTP
NGINX_CONTAINER_SSL_PORT Host port for HTTPS
MARIADB_CONTAINER_PORT Host port for MariaDB
WP_HOME Full URL including port (e.g. https://barberklingen.dk-local:449)
ELEMENTOR_EMAIL / ELEMENTOR_LICENSE Required for Composer Elementor repo

The root .env is mounted into the container as site/.env.override, allowing local overrides without modifying the vault-encrypted site/.env.

3. Start Docker containers

docker compose up -d

This starts: - PHP (php-fpm, runs on devops/local/php/Dockerfile) - Nginx (serves web/ docroot) - MariaDB (database, via docker-compose.override.yml) - Redis (object cache)

Check container health:

docker compose ps
docker compose logs -f php

4. Install PHP dependencies

Run inside the PHP container or locally if PHP 7.4+ is available:

cd site
composer install

Private packages from packagist.barberklingen.dk require your SSH key to be authorised on the server. Elementor Pro requires ELEMENTOR_EMAIL and ELEMENTOR_LICENSE to be set so Composer can authenticate with composer.elementor.com.

5. Build frontend assets

cd site
yarn install
yarn dev        # one-time development build
# or
yarn watch      # rebuild on file changes

Assets are compiled from customizations/statics/ into customizations/plugin/assets/.

6. Access the site

Navigate to the URL set in WP_HOME in your .env file.

WordPress admin: {WP_HOME}/wp/wp-admin

WP-CLI

wp-cli.yml in site/ sets the WordPress path and docroot, so WP-CLI commands can be run from site/:

cd site
wp option get siteurl
wp plugin list
wp barberklingen database migrate

Logs

Log files are mounted from Docker into system/logs/:

File Source
system/logs/nginx-access.log Nginx access log
system/logs/nginx-error.log Nginx error log
system/logs/bedrock-debug.log WordPress debug log (WP_DEBUG_LOG)
system/logs/php-slow.log PHP-FPM slow log

Troubleshooting

Containers not starting: Check .env for missing required variables. MariaDB healthcheck can take 30+ seconds on first boot.

Composer auth errors: Ensure your SSH key is authorised on packagist.barberklingen.dk and that ELEMENTOR_EMAIL/ELEMENTOR_LICENSE are set.

WP_HOME or WP_SITEURL not set errors: Make sure site/.env (or site/.env.override) contains these values. The root .env is mounted as .env.override automatically by Docker.