Docker WordPress for developers based on https://docs.docker.com/compose/wordpress/
Create directory for your project (for example my_wordpress)
mkdir my_wordpress
Now go to your project directory:
cd my_wordpress
And run command:
docker-compose up -d
This runs docker-compose up in detached mode, pulls the needed Docker images, and starts the wordpress and database containers.
At this point, WordPress should be running on port 8000 of your Docker Host.
If you are using Docker Desktop for Mac or Docker Desktop for Windows, you can use http://localhost as the IP address, and open http://localhost:8000 in a web browser.
- Added .env file for environment configuration.
Installed Docker with Docker Compose, Git.
Edit .env file:
# Set path to your wp-content directory
APP_PATH=./wp-content/
# Database configuration
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=wordpress
DB_USERNAME=wpuser
DB_PASSWORD=wp_password
DB_ROOT_PASSWORD=wp_root_password
