Skip to content

hamishau/docker.wordpress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This is a guide to set up a new WordPress installation running in Docker, with WP-CLI available for database management. The only prerequisite is Docker.

Clone Repository

git clone git@github.com:hamishau/vagrant.wordpress.git

Project Name

Edit .env to set the database name, credentials, port, site title, and admin login.

Deploy

docker compose up -d

WordPress is automatically installed during the first deploy. Once the containers are running, the site is available at http://localhost:8080. Log in at http://localhost:8080/wp-admin with the credentials configured in the setup service (default: admin / admin).

Containers are set to restart: "no" and will not start automatically on boot or Docker daemon restart. Use the commands below to manage them manually.

Start / Stop

Start containers

docker compose start

Stop containers

docker compose stop

Post Installation

These are not required as part of the deployment — just helpful commands for ongoing development.

Export Database

docker compose run --rm cli wp db export - --allow-root > yourapp.sql

Import Database

docker compose run --rm cli wp db import - --allow-root < yourapp.sql

Reset Database

docker compose run --rm cli wp db reset --yes --allow-root

Run Any WP-CLI Command

docker compose run --rm cli wp <command> --allow-root

Update WP-CLI

docker compose run --rm cli wp cli update --allow-root

Destroy Everything (including database)

docker compose down -v

About

This is a 5 minute deployment of a new WordPress installation, running in Docker.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors