This is a Wordpress template configured for ephemeral development environments on Gitpod.
Click the button below to start the Gitpod development environment:
This will run and install Wordpress and expose it to the public from your Gitpod environment.
The admin interface can be accessed then with username admin and password admin.
phpMyAdmin is also spun up in private
and can be accessed using the username root and password supersecretpassword.
A MailHog container is also provided in private.
To make use of this repository in your own project, either fork this repository or
just copy the .gitpod.yml, mailhog.php
and docker-compose.yaml files to your project folder.
docker-compose.yaml(Docker compose file that defines amysql,wordpress,phpMyAdmin,MailHogand awp-clicontainer).gitpod.yml(Gitpod configuration file that will start and install Wordpress on docker containers)mailhog.php(Tweaked MailHog Wordpress plugin definition for the docker environment)README.md(this document)
You can use docker compose commands to manage the containers. Check out
the docker compose documentation
for more details.
docker compose down --rmi all -vdocker compose up --quiet-pull -ddocker compose exec wp-cli /bin/bash -c '\
wp core install \
--path="/var/www/html" \
--url="'$(gp url 8000)'" \
--title="${WORDPRESS_SITE_NAME}" \
--admin_user="${WORDPRESS_ADMIN_USER}" \
--admin_password="${WORDPRESS_ADMIN_PASSWORD}" \
--admin_email="${WORDPRESS_ADMIN_EMAIL}"\
'Note: The variables used in the above command are expanded in the wordpress-cli container itself,
except the gp url 8000 command which is expanded on the Gitpod host instead
(hence the closing and re-opening the single quotes).
docker compose exec wp-cli wp --infoThe gp command line tool can be used to manage the Gitpod workspace from the terminal. Check out
the gp command documentation
for more details.
gp url 8000This is useful as the Gitpod Free plan only allows you 50 hours of work a month.
gp stop