Skip to content

Develop & Build GatsbyJS static sites within Docker.

License

Notifications You must be signed in to change notification settings

IgorMazur/docker-build-and-deploy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-build-and-deploy

Develop & Build GatsbyJS static sites within a Docker container. Server static website content with Nginx Alpine Docker container.

  • 🚮 Clutter-free host machine: No need to install Node/Gatsby/Webpack/etc on your host machine! Only Docker required (tested on v17.12.0).
  • 🏗 Easy setup: Automatic GatsbyJS site initializion with gatsby-starter-default (unless already initialized)
  • 👍 Simple CLI API: develop/stage/build
  • 🆕 Recent NodeJS: Container based on NodeJS v10.15.2 running in Ubuntu Linux 19.04
  • 📃 MIT-licensed

Setup

NOTE: Your GatsbyJS site will be created into $GATSBY_ROOT defined in .makerc automatically.

Usage

Init

Before your either start developing or running nginx in production you should init your environment with the following:

make init
# edit .makerc
make gatsby__docker_build

Develop

make gatsby_develop

Stage

In other words, build and serve:

make gatsby_stage

Build

Builds production ready site into $GATSBY_ROOT/public:

make gatsby_build

Run arbitary command inside the container

make gatsby__docker_run cmd=<YOUR-COMMAND-HERE>

For example to install a new NPM-module:

make gatsby__docker_run cmd=yarn add gatsby-transformer-yaml

Run Nginx in production

make gatsby_build
make nginx_stage_build
make nginx_stage_run

About

Develop & Build GatsbyJS static sites within Docker.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Makefile 56.3%
  • Shell 40.9%
  • Python 2.8%