👉 I stopped working on this at some point, but please feel free to use this as a basis or to contribute
This repository aims to serve as a starter kit for a self-hosted Jamstack website using Gatsby and Strapi bootstrapped as Docker containers ready to be deployed.
I'm open to suggestions and contributions! 🚀
I wanted to create a modern web environment that is convenience-first (similar to WordPress with the ACF plugin installed, but less monolithic), uses a modern tech stack under the hood (Node.JS), is cheap to host (Any Docker host, really), and SEO-friendly (SSG).
- Clone the repository
- Install the gatsby CLI globally on your system
npm install -g gatsby-cli
oryarn global add gatsby-cli
cd
into the gatsby folder and install the dependenciesnpm install
oryarn
cd
into the strapi folder and add a .env file with the following contents:
HOST=0.0.0.0
PORT=1337
APP_KEYS=<YOUR_APP_KEYS>
API_TOKEN_SALT=<YOUR_API_TOKEN_SALT>
ADMIN_JWT_SECRET=<ADMIN_JWT_SECRET>
JWT_SECRET=<JWT_SECRET>
To generate .env contents you could install a separate Strapi instance using npx create-strapi-app@latest my-project --quickstart
which can be deleted afterward.
- Run
make dev
in order to run Strapi and a Postgres database dockerized and Gatsby in development mode. - Locate Gatsby under
localhost:8000
and Strapi underlocalhost:1337
- In order to make Strapi expose the preconfigured Pages collection type, navigate to Settings -> Roles -> Public and make sure "find" under Pages and everything under Content type builders is checked. If gatsby is throwing an error please rebuild the data layer or refer to the Gatsby documentation.
Test the setup in production mode running make prod
. It should run on any Docker host with docker-compose installed using docker-compose -f docker-compose.prod.yml up
.