TelemundoDigitalUnit / NBC_Docker

0 stars 1 forks source link

NBC WordPress Docker Setup

A Docker Container which setups up WordPress with PHP-FPM, Nginx with a self-signed SSL certificate, WordPress CLI, MariaDB, memcache and phpMyAdmin. In addition, the setup script will install the WordPress VIP MU Plugins and the NBCOTS VIP repository if you have access. You will need to learn the Docker Compose commands to spin down containers and spin them back up.

Prerequisites

Here are a list of frameworks you need to have pre-installed on your machine. If you happen to shortcut the installation the local development environment will not run properly.

Installation

  1. Start Docker Desktop and wait till the status reads Docker Desktop is running
  2. In Terminal, run the following command: ./local_init.sh
  3. Once setup has been completed, add this line above require_once( ABSPATH . 'wp-settings.php' ); in your wp-config.php:

require_once( ABSPATH . 'wp-content/vip-config/vip-config.php' );

  1. Visit http://localhost/wp-admin on your browser and sign in using credentials stored inside of the .env file.
  2. Activate the NBC Theme.
  3. All your work should be within the wp-content folder. DO NOT commit to the main Docker Container repository.

Troubleshooting

Removing Orphan Containers

Run the following commands to ensure orphaned containers are removed.

docker-compose down --remove-orphans
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

Enable theme/WP Plugin error

If you get an error similar to:

Uncaught Error: Call to undefined function NBC\get_site_host() ...

It's likely the nbc-station theme didn't get activated. Run this to fix:

docker-compose run wp-cli theme enable nbc-station --network
docker-compose run wp-cli theme activate nbc-station

Questions?

Have you got questions? Problems with the installation? Use Google, ask your neighbor or ask questions in Slack.