hingeltd/wordpress-starter

WordPress boilerplate with Bedrock, Lumberjack, Laravel mix on Docker

v1.0.2 2019-04-10 16:25 UTC

This package is auto-updated.

Last update: 2024-04-11 03:17:41 UTC


README

This repository is a boilerplate for setting up a Wordpress project on a Mac or Linux host machine and is based on the following stack:

Requirements

  • Docker engine >= v1.13
  • Docker compose >= v1.12
  • node >= v10.8.0
  • npm >= 6.3.0
  • PHP >= 7.1
  • Composer - Install

Installation

  • Create a new project:

    $ composer create-project hingeltd/wordpress-starter
  • Run the following command to setup docker containers for your project. Unless the .env details are change as per the following step, make sure that PORT 80 and PORT 3306 is not being currently used by any other services

        $ docker-compose up -d
  • Install the npm packages with the following command on the Lumberjack root at web/app/themes/lumberjack/

     $ npm install
  • Run a dev build on the same directory to have the theme assets built for frontend

     $ npm run dev
  • Initial variables are already setup to be used both by Wordpress and docker but you can update environment variables in the .env file:

    • Database variables
      • DB_NAME - Database name
      • DB_USER - Database user
      • DB_PASSWORD - Database password
      • DB_HOST - Database host
    • WP_ENV - Set to environment (development, staging, production)
    • WP_HOME - Full URL to WordPress home (http://localhost)
    • WP_SITEURL - Full URL to WordPress including subdirectory (http://localhost/wp)
    • AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, NONCE_KEY, AUTH_SALT, SECURE_AUTH_SALT, LOGGED_IN_SALT, NONCE_SALT
    • MYSQL_PORT - Docker Mysql Container port
    • WEB_PORT - Docker Web Server (nginx) port if you want to use any other port than port 80. If you use any other port, make sure to change the WP_HOME from http://localhost to http://localhost:PORT
  • Rebuild the container if the .env variables is updated with the following command sh $ docker-compose up --build

  • Setup Wordpress locally following the standard wordpress installation steps or import an existing database locally to skip this step.

  • Access the Wordpress site at http://localhost and access WordPress admin at http://localhost/wp/wp-admin/