-
Install Docker
-
Start developing.
Just startup all your environment with one of this commands
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
ornpm 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.
-
To shut down environment just type
docker-compose down
ornpm run docker:down
Setup your local Strapi :
- Make an initial Strapi installation
- In Content Type Builder create entity with desirable schema
- Create content for previously created entity in created Content Type
- Go to the Roles & Permissions section and edit roles
Authenticated
andPublic
to grant access to CRUD operations. At leastfind
andfindOne
for fetching. Instead you will always getting 403 Forbidden error. - Define entities in Gatsby
gatsby-config.js
. AddcontentTypes: ['pages'],
to allow gatsby prefetch needed data and describe GraphQL model. - Try out result in browser, ex.:
localhost:1337/pages
if you create Page content type. - Since we edit gatsbe config - better to rebuild image
docker-compose build
and run project againnpm 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
}
}
}
}