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
.
You need to pass several arguments such as:
- DB_PASS When the DB is raised this will be its root password
export DB_PASS=YOUR_SUPER_SECURE_PASSWORD && export UID && docker-compose up
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). You can stop it when you are not using it withdocker-compose stop wp_phpmyadmin
Your Movefile
must be inside configs/wordmove/
.
We recommend to have a repo for your WordPress site, so the themes and plugins should be deployed by a git pull
command.
By the moment we don't expose the wordmove entrypoint in the container so you need to login to container and execute the following commands
docker-compose run --rm wp_wordmove /bin/bash
wordmove init
wordmove push --uploads
wordmove push --db
This docker compose was made to have a modern WP dev environment which can be portable, easy to set up and with HTTPS with letsencrypt.
You need to pass several arguments such as:
- DB_PASS When the DB is raised this will be its root password
- DOMAIN Put your domain your-domain.com. This is needed to the https set up.
- EMAIL Put your email domain email@your-domain.com. This is needed to the https set up.
export DB_PASS=YOUR_SUPER_SECURE_PASSWORD && export DOMAIN=your-domain.com && export EMAIL=email@your-domain.com && docker-compose --file docker-compose-production.yml up -d && docker-compose --file docker-compose-production.yml stop wp_phpmyadmin
This will stop the phpmyadmin service for security reasons, if you want to run it just
docker-compose --file docker-compose-production.yml start wp_phpmyadmin
In this section you will find development and production common features.
- Create the user using phpmyadmin
- allow connection from any host
- create a database with the same name with all privileges
- Download the WordPress core using
docker-compose run --rm --user=82 wp_server wp core download
- Create your
wp-config
filedocker-compose run --rm --user=82 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 run --rm --user=82 wp_server wp core install --prompt
- 1/6 --url=<url>:
localhost
- 2...6 - Your personal configuration
- 1/6 --url=<url>:
Remember that if you are on production you must specify docker compose file using
--file docker-compose-production.yml
-
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 DB_PASS=YOUR_SUPER_SECURE_PASSWORD export DOMAIN=your-domain.com && export EMAIL=email@your-domain.com && docker-compose up
-
To verify the version run
docker-compose run --rm wp_server php --version
Written with StackEdit.