Create a docker-compose.yml in your project folder:
version: "3"
services:
frontend:
image: rocketfactory/docker-alpine-gatsby-dependencies
command: npm run develop
volumes:
- ./frontend:/home/app
ports:
- "8000:8000"
install-frontend:
image: rocketfactory/docker-alpine-gatsby-dependencies
command: npm install
volumes:
- ./frontend:/home/appRun this in your project folder to get the Gatsby starter
git clone https://github.com/gatsbyjs/gatsby-starter-default.git frontend --single-branchThen install dependencies
docker-compose up install-frontendChange scripts.develop in frontend/package.json to:
"scripts": {
...
"develop": "gatsby develop -H 0.0.0.0",
...
}Start the development server
docker-compose up frontendNavigate to http://localhost:8000/