Docker image used for installing WPC locally, when WPC was a tool that required installation.
1.5K
This tool is used to add shell scripts and configuration files that allow running WordPress in Docker containers for development (this setup is not suitable for production deployments).
If the repository you're using already has wpc you'll find the following files:
script/server - run WordPress in a container
script/setup - install WordPress
admin with password adminsetup/ directoryscript/update - run any updates after checking out the latest version
script/console - open a /bin/sh console inside the main containerscript/bootstrap - update dependencies (this is called by script/setup and script/update)bin/wp - run wp-clidocker-compose.yml - the Docker Compose configuration for running the development environmentconfig/server.php - configuration that would normally go in wp-config.php (checked into the repository - used for the development envirnoment)config/server-local.php - configuration that would normally go in wp-config.php (not checked into the repository)setup/internal.sh - this is run by script/setup, it runs the wp-cli commands to install WordPressDocker & Docker Compose.
macOS:
wpc onto your computerAdd this alias to your shell's configuration:
alias wpc='docker run -ti --rm -v `pwd`:/app thedxw/wpc'
go get github.com/dxw/wpc
wpc into a WordPress projectwpcRun wpc name-of-project or wpc name-of-project --multisite in the root of the project.
--multisite will add the appropriate configuration options for running the site as multisite.
Edit setup/internal.sh to enable plugins and themes or set the name of the site, or anything else you can do with wp-cli. (setup/external.sh also exists, if you need to run commands outside of the container).
WXR files containing WordPress content can be placed in the project's setup/content/ folder. This content will be imported on running the project for the first time.
wpc projectRunning it for the first time:
script/server
# Wait for the server to be running
script/setup
Running the project the next time:
script/server
Running the project after checking out the latest version:
script/server
# Wait for the server to be running
script/update
You can also use script/server -d to start the containers in detached mode (i.e. without any output to your terminal window).
/bin/sh console running on the WordPress container: script/consolebin/wp db cliAll the ports that docker will be listening on (80, 1080, 2080, 3066 & 11300) need to be available, so if you've got local processes running on them, that will stop the containers starting up, usually with an EADDRINUSE error.
Things that might be running on port 80: apache (stop with sudo apachectl stop), any other local server (e.g. XAMPP)
Things that might be running on port 3306: mysql (stop with mysql.server stop)
When the image is built, a copy of the latest version of WordPress is downloaded.
When running the image, it will check for updates before starting Apache. However it can be configured to download other versions of WordPress via the WORDPRESS_VERSION environment variable.
Example docker-compose.yml file (the last two lines should be added - the rest are there by default):
wordpress:
image: thedxw/wpc-wordpress
ports:
- "80:80"
links:
- mysql
- mailcatcher
- beanstalk
volumes:
- .:/usr/src/app
- ./wp-content:/var/www/html/wp-content
environment:
WORDPRESS_VERSION: 4.7
Templates live in templates/ and can be compiled into raw_templates.go by running go generate.
Content type
Image
Digest
Size
297.5 MB
Last updated
over 5 years ago
docker pull thedxw/wpc