This docker compose was made to have a modern WP dev environment which can be portable, easy to set up and focused on the use of wp
.
With
docker-compose up
it will run a phpmyadmin service, this is created with goal of facilitate the management of the DataBase (not all of us are command ninja) so we recommend, stop it when you are not using it.docker-compose stop wp_phpmyadmin
For be able to manipulate easily the files of wordpress you need to:
export UID && docker-compose up
- Create the user using phpmyadmin
- allow conection from any host
- create a database with the same name with all priviledges
- Download the WordPress core using
docker-compose exec wp_server wp core download
- Create your
wp-config
filedocker-compose exec wp_server wp core config --prompt
- 1/12 --dbname=<dbname>:
YOUR_DB_NAME
- 2/12 --dbuser=<dbuser>:
USER_CREATED_AT_1
- 3/12 [--dbpass=<dbpass>]:
PASS_CREATED_AT_1
- 4/12 [--dbhost=<dbhost>]:
wp_mariadb
- 5...12 - Default values set by enter
- 1/12 --dbname=<dbname>:
- Install WordPress site
docker-compose exec wp_server wp core install --prompt
- 1/6 --url=<url>:
localhost
- 2...6 - Your personal configuration
- 1/6 --url=<url>:
-
stop everything with
docker-compose stop
-
On the
docker-compose.yml
file, on servicewp_server
on the sectionargs
leave uncommented the php version that you wantargs: PHP_VERSION: 7.1 # PHP_VERSION: 7.0 # PHP_VERSION: 5.6
-
Then build the new image with:
docker-compose build
-
Run everything again:
export UID && docker-compose up
-
To verify the version run
docker exec wp_server php --version
Written with StackEdit.