Skip to content

Develop & Build GatsbyJS static sites within Docker.

License

Notifications You must be signed in to change notification settings

gu-stav/gatsby-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 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

Build the image

docker build --tag gatsby-docker:1.0 .

Develop

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

Stage

In other words, build and serve:

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

Build

Builds production ready site into site/public:

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

Run arbitary command inside the container

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

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

About

Develop & Build GatsbyJS static sites within Docker.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 70.8%
  • Dockerfile 29.2%