Skip to content

Local Setup

This guide walks you through getting the project running locally using Docker.

Prerequisites

  • Docker and Docker Compose
  • SSH access to GitHub (for cloning)
  • SSH access configured for packagist.subscribed.build (for private Composer packages)

Verify Docker is installed:

docker -v
docker compose version

Steps

1. Clone the repository

git clone git@github.com:subscribed-aps/elome-com-bedrock.git
cd elome-com-bedrock

2. Configure the root .env

The root .env controls Docker (container names, ports, project name):

cp .env.example .env

Adjust values as needed — particularly PROJECT_NAME, PROJECT_URI, WP_HOME, and any port mappings if you have conflicts.

3. Install Composer dependencies

Dependencies are installed inside the container, but you can also run Composer locally if you have PHP 7.4+ available:

cd site
composer install

Make sure your SSH key is added to the agent (ssh-add ~/.ssh/your_key) so Composer can authenticate against packagist.subscribed.build.

4. Start Docker containers

From the repo root:

docker compose up -d

This starts: - PHP-FPM — application container - Nginx — web server - Redis — object cache - MariaDB (if included in your local override)

5. Seed the database

cd site/docker/wp
./dev-setup.sh

This script: - Creates the database if it doesn't exist - Imports the dev schema (docker/wp/data/dev-schema.sql) - Installs WordPress via WP-CLI if not already installed - Activates required plugins and the theme - Runs database migrations

Default dev credentials (set in .env): - URL: value of WP_HOME in your .env - Username: DEV_EMAIL (default: dev@subscribed.local) - Password: ADMIN_PASSWORD (default: glatteboller)

6. Access the site

Open the URL defined in WP_HOME in your .env. The WordPress admin is at {WP_HOME}/wp/wp-admin/.

Environment Variables

The project uses a layered env setup:

File Purpose
.env Root env for Docker (ports, container names)
site/.env WordPress application env (loaded by Bedrock)
site/.env.vault Encrypted vault file (committed to repo)
site/.env.override Local overrides (gitignored)

The DOTENV_KEY secret is used to decrypt .env.vault at runtime. For local development, you can place values directly in site/.env or site/.env.override.

Useful Commands

# Run WP-CLI inside the PHP container
docker exec -it <php-container-name> wp <command> --allow-root

# Run tests
cd site && composer test

# Run code style checks
cd site && vendor/bin/phpcs

# Tail PHP logs
tail -f system/logs/bedrock-debug.log

Troubleshooting

  • Composer auth errors — Ensure your SSH key is loaded: ssh-add -l. The packagist server requires SSH access.
  • Port conflicts — Edit the port variables in .env (e.g. NGINX_CONTAINER_PORT, REDIS_CONTAINER_PORT).
  • Database not found — Re-run dev-setup.sh, or manually create the DB: docker exec -it <mariadb-container> mariadb -uroot -p.