All Projects → STUkh → gatsby-strapi-docker

STUkh / gatsby-strapi-docker

Licence: MIT license
A simple starter to get up and developing quickly with Gatsby, Strapi and wrap everything in Docker

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
Dockerfile
14818 projects
shell
77523 projects

Gatsby Strapi 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.yml -f docker-compose.dev.yml up or npm run docker:dev

    Initially it will create image: download and setup layers for NodeJS, Strapi, Mongo 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 Strapi :

  1. Make an initial Strapi installation
  2. In Content Type Builder create entity with desirable schema
  3. Create content for previously created entity in created Content Type
  4. Go to the Roles & Permissions section and edit roles Authenticated and Public to grant access to CRUD operations. At least find and findOne for fetching. Instead you will always getting 403 Forbidden error.
  5. Define entities in Gatsby gatsby-config.js. Add contentTypes: ['pages'], to allow gatsby prefetch needed data and describe GraphQL model.
  6. Try out result in browser, ex.: localhost:1337/pages if you create Page content type.
  7. Since we edit gatsbe config - better to rebuild image docker-compose build and run project again npm run docker:dev or with full command as described in quick start.
  • Go to the GrapihQL editor and try out queries. Example:
{
  allStrapiPages {
    edges {
      node {
        id,
        route
      }
    }
  }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].