- Notifications
You must be signed in to change notification settings - Fork2
bogkonstantin/wordpress-docker
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
You needDocker to be installed with docker-compose.
Also, a WordPress backup plugin is needed. The plugin should download the database dump in SQL format and all necessary WordPress files.
I tested it withbackwpup plugin. With this plugin, you need to create a cron-job to generate backup files. Run job and download results.
Clone this repository to the desired folder using the command below.
git clone git@github.com:bogkonstantin/wordpress-docker.git
Change PHP version indocker/php/Dockerfile
if needed. Change MySQL version indocker-compose.yml
if needed.
Copy website files to thewp
folder.
Add towp-config.php
local database connection values. See it in thedocker-compose.yml
or override using the.env
file.
Default parameters:
define('DB_NAME',"db" );define('DB_USER',"dbuser" );define('DB_PASSWORD',"pass" );define('DB_HOST',"db" );
Set domain to localhost inwp-config.php
:
define('WP_HOME','http://localhost');define('WP_SITEURL','http://localhost');
Copy database dump todb_init
folder.
Override config values in.env
files if needed. See the list of available variables in thedocker-compose.yml
file.
Use it with docker-compose commands. For example, start the application with the command:
docker-compose up -d
Stop application (containers) with the command:
docker-compose down
Now you can open your website locally using the linkhttp://localhost
Config Xdebug in your IDE if necessary.
Feel free to contribute to this repository.
And don't forget to check your website availability withuptime.onl.
About
Docker environment for local Wordpress development
Resources
Uh oh!
There was an error while loading.Please reload this page.