Wordpress Docker Starter Kit
458
The only thing you need to get started is a docker-compose.yml file:
version: '2'
services:
wordpress:
image: visiblevc/wordpress:latest
ports:
- 8080:80
- 443:443
volumes:
- ./wp-content/uploads:/app/wp-content/uploads
- ./yourplugin:/app/wp-content/plugins/yourplugin # Plugin development
- ./yourtheme:/app/wp-content/themes/yourtheme # Theme development
environment:
WORDPRESS_DB_HOST: host
WORDPRESS_DB_USER: user
WORDPRESS_DB_PASSWORD: password
WORDPRESS_DB_NAME: dbname
PLUGINS: >-
academic-bloggers-toolkit,
co-authors-plus,
[WP-API]https://github.com/WP-API/WP-API/archive/master.zip,
[local]my-local-plugin
THEMES: >-
[local]my-local-theme
SEARCH_REPLACE: yoursite.com,localhost:8080
WP_DEBUG: 'true'
volumes:
data: {}
Need PHPMyAdmin? Add it as a service
version: '2'
services:
wordpress:
# same as above
db:
# same as above
phpmyadmin:
image: phpmyadmin/phpmyadmin
environment:
MYSQL_ROOT_PASSWORD: root
ports:
- 22222:80
volumes:
data:
Notes:
boolean environment variableswordpress| Variable | Default Value | Description |
|---|---|---|
ADMIN_EMAIL | admin@${DB_NAME}.com | Administrator email address |
WP_DEBUG | 'false' | Click here for more information |
WP_DEBUG_DISPLAY | 'false' | Click here for more information |
WP_DEBUG_LOG | 'false' | Click here for more information |
WP_VERSION | latest | Specify the WordPress version to install. Accepts any valid semver number, latest, or nightly for beta builds. |
THEMES | Comma-separated list of themes you want to install in either of the following forms
| |
PLUGINS | Comma-separated list of plugins you want to install in either of the following forms:
| |
MULTISITE | 'false' | Set to 'true' to enable multisite |
PERMALINKS | /%year%/%monthnum%/%postname%/ | A valid WordPress permalink structure tag |
SEARCH_REPLACE | Comma-separated string in the form of current-url,replacement-url
| |
VERBOSE | 'false' | Set to 'true' to run build with verbose logging |
wp-cliYou can access wp-cli by running npm run wp .... Here are some examples:
npm run wp plugin install <some-plugin>
npm run wp db import /data/database.sql
Sometimes your development environment runs on a different domain than your live one. The live will be example.com and the development localhost:8080. This project does a search and replace for you. You can set the SEARCH_REPLACE: example.com,localhost:8080 environment variable in the docker-compose.yml.
Content type
Image
Digest
Size
180.5 MB
Last updated
almost 8 years ago
docker pull gsandf/wordpress-docker-starter