A starter kit for WordPress projects
- Docker
- With MailHog
- WordPress
- Themes
- JuicyStrap - A barebones WordPress starter theme
- NO LONGER includes Bootstrap!
- Bootstrap was great for providing a good grid system supported by all browsers, but the web has come a long way and it's now dead simple to build your own grid system. Bootstrap tended to add a lot of bloat through components and utilities which often went unused. It's time to say goodbye and get familiar with CSS Grid and Flex instead!
- Includes:
- Font Awesome Pro 6
- Laravel Mix for asset compilation
- Babel for ESNext transpilation
- Prettier for code style consistency
- Stylelint for stylesheet code quality
- ESLint for JS code quality
- EditorConfig for code style consistency
- NO LONGER includes Bootstrap!
- A WordPress default theme (useful as a fallback for debugging)
- JuicyStrap - A barebones WordPress starter theme
- Plugins
- Advanced Custom Fields Pro
- WP Media Offload Lite
- Disable Embeds
- EWWW Image Optimiser
- Gravity Forms
- WordFence
- Yoast SEO
- WP Mail SMTP
- WP Super Cache
- Create a new GitLab Project if one does not already exist.
- Download an archive of this repository. Unzip it and rename it to the project name.
- Initialise your repo
git init git checkout -b main git remote add origin git@gitlab.com:juicy-media-ltd/<PROJECT_SLUG>.git
- In
.docker/.env.example
, change the value of thePHP_IDE_CONFIG
server name to the name of the project. - Duplicate
.env.example
, renaming it to.env
. - It's probably a good idea to change the ports this project is bound to, so that they don't clash with other projects you may have running. Change these in docker-compose.yml if required and update this README accordingly.
- Open the
Dockerfile
, set the base image (FROM wordpress:php...
) to the latest version of WordPress and PHP supported by the WordPress Docker image. - Open a terminal at the project root, run
docker-compose build
thendocker-compose up
. - Rename the
juicystrap
folder inwordpress/wp-content/themes/wp-content/themes
to the theme name. - Run and a find and replace on the theme folder, replacing
juicystrap
with your theme name. - Update the theme information in
wordpress/wp-content/themes/<THEME_NAME>/style.css
. - Open a terminal at
wordpress/wp-content/themes/<THEME_NAME>
, runnpm install
thennpm run dev
. - Head to http://localhost:32080 in your browser, you should see the setup page.
- Set up the WordPress site:
- Step 1:
- Site title:
<PROJECT_NAME>
- Username:
juicyadmin
- Password:
<RANDOM_STRONG_PASSWORD>
- Email:
admin@juicymedia.co.uk
- Site title:
- Step 1:
- Save these credentials to the Juicy Logins 1Password Vault
- Log into the admin panel, check everything more or less works.
- Activate the theme.
- Update Plugins.
- Activate and set up the plugins as much as possible. You can skip enabling plugins that aren't needed during
development (e.g. WordFence, WP Super Cache). Remove any that may not be applicable to the project.
- WP Mail SMTP is set up via
wp-config.php
and.docker/.env
to send mail on local development to MailHog. Access MailHog at http://localhost:32082.
- WP Mail SMTP is set up via
- At the root of the project,
run
docker-compose exec db /usr/bin/mysqldump -u root --password=wordpress wordpress > .docker/db-entrypoint/wordpress.sql
. This will dump the DB so it can be committed to git and used as a starting point for developers on this project. It's worth regularly updating this file as the project develops. - Rename
.gitlab-ci.yml.sample
to.gitlab-ci.yml
, configure the file with the theme name and add or remove any relevant jobs - Edit this
README.md
:- Remove these instructions
- Uncomment the block below
- Fill the
<PLACEHOLDERS>
- READ and review it - it has useful information that you should be aware of, and you may need to tweak or remove information that might not be applicable to your project.
- Commit your project and push
- Open up your project on GitLab
- In Deployments > Environment, add two new environments, one called
production
and the otherstage
. - In Settings > Repository, under Protected Tags add
v*
and only allow Maintainers to create it. - In Settings > CI/CD > Variables, add the following:
- AWS_DEFAULT_REGION:
eu-west-2
- ROLE_ARN:
arn:aws:iam::948445212038:role/GitLab-OIDC
- IMAGE_NAME:
wordpress
- Once they've been set up in AWS, for each environment add:
- ECS_CLUSTER: The name of the ECS cluster in AWS
- ECS_SERVICE: The name of the ECS service in AWS (probably the same as the cluster name)
- AWS_DEFAULT_REGION:
git add .
git commit -m "Initial commit"
git push -u origin main