Skip to content

Develop & Build GatsbyJS static sites within Docker.

License

Notifications You must be signed in to change notification settings

mjroson/gatsby-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gatsby-docker

Develop & Build GatsbyJS static sites within a Docker container.

Setup

NOTE: Your GatsbyJS site will be created into $(pwd)/site automatically.

Add these to your .gitignore:

site/node_modules
site/public
site/.cache

Usage

New default or starter

docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 aripalo/gatsby-docker new
docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 aripalo/gatsby-docker new https://github.com/justinformentin/gatsby-v2-tutorial-starter

Develop

docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 aripalo/gatsby-docker develop

Stage

In other words, build and serve:

docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 aripalo/gatsby-docker stage

Build

Builds production ready site into site/public:

docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 aripalo/gatsby-docker build

Run arbitary command inside the container

docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 aripalo/gatsby-docker <YOUR-COMMAND-HERE>

For example to install a new NPM-module: docker run -it --rm -v $(pwd)/site:/site aripalo/gatsby-docker yarn add gatsby-transformer-yaml

Install gatsby-client and use this docker like to the oficial gatsby-cli

sudo pip3 install git+https://github.com/mjroson/gatsby-docker
Requirements:
  • Installed docker and can use docker with your current user
  • Python 3 and pip3 installed
Create and run new project with gatsby-client. Ex.
mkdir blog
cd blog
gatsbyjs new https://github.com/justinformentin/gatsby-v2-tutorial-starter
# chose npm
gatsbyjs develop

Next?

  • Support for use more params to gatsby's commands
  • Support for all operative systems (currently only supports linux)

About

Develop & Build GatsbyJS static sites within Docker.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 47.9%
  • Python 37.0%
  • Dockerfile 15.1%