Skip to content
This repository was archived by the owner on Dec 16, 2024. It is now read-only.

Setup GatsbyJS with Wordpress as REST API source in Docker 🐳

License

Notifications You must be signed in to change notification settings

ryanturnerwebdev/gatsby-wordpress-docker

 
 

Repository files navigation

Gatsby Wordpress Docker 🐳 example

🚀 Quick start

  1. Install Docker

  2. Start developing.

    Just startup all your environment with one of this commands

    docker-compose -f docker-compose.yaml -f docker-compose.dev.yaml up or npm run docker:dev

    Initially it will create image: download and setup layers for NodeJS, Wordpress, MySQL and Gatsby, and startup containers. Further runnings will only startup containers.

  3. To shut down environment just type docker-compose down or npm run docker:down

🧐 What's next?

Setup your local Wordpress :

  1. Make an initial installation
  2. Enable Wordpress plugins ( ACF to REST API, Advanced Custom Fields, Custom Post Type UI, WP REST API Menus )
  3. Setup pretty permalinks Settings => Permalinks => choose 'Post name' and save.

Restart Gatsby container manually or stop/start everything to make Gatsby properly initialized

  • Go to the GrapihQL editor and try out queries:
{
  allWordpressPost {
    edges {
      node {
        id
        slug
        title
        content
        excerpt
        date
        modified
      }
    }
  }
}

Addtinional Info

After wordpress setup in wordpress/engine folder will be content that bind directly to wordpress container. You can easily modify it locally.

!!! Note that wordpress/plugins_for_setup used to copy initial plugins for setup. Don't use this folder after wordpress initialization.

🎓 Useful Links

Looking for more guidance? Full documentation for Gatsby lives on the website. Here are some places to start:

About

Setup GatsbyJS with Wordpress as REST API source in Docker 🐳

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 72.8%
  • JavaScript 25.6%
  • CSS 1.6%