Skip to content

szilvesztercsab/gitpod-wordpress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

A Wordpress template on Gitpod

This is a Wordpress template configured for ephemeral development environments on Gitpod.

Usage

Click the button below to start the Gitpod development environment:

Open in Gitpod

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.

Files

Working with the containers

You can use docker compose commands to manage the containers. Check out the docker compose documentation for more details.

Stop containers and remove them

docker compose down --rmi all -v

Start containers

docker compose up --quiet-pull -d

Install wordpress from the command line

docker 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).

Get information on the Wordpress instance

docker compose exec wp-cli wp --info

Working with Gitpod

The gp command line tool can be used to manage the Gitpod workspace from the terminal. Check out the gp command documentation for more details.

Get the public url of the Wordpress instance

gp url 8000

Stop the Gitpod workspace

This is useful as the Gitpod Free plan only allows you 50 hours of work a month.

gp stop

Contributors

Languages