Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aripalo/gatsby-docker
Develop & Build GatsbyJS static sites within Docker.
https://github.com/aripalo/gatsby-docker
containers docker gatsby gatsbyjs static-site static-site-generator
Last synced: 2 months ago
JSON representation
Develop & Build GatsbyJS static sites within Docker.
- Host: GitHub
- URL: https://github.com/aripalo/gatsby-docker
- Owner: aripalo
- License: mit
- Created: 2018-02-07T18:34:08.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-14T14:38:03.000Z (almost 5 years ago)
- Last Synced: 2024-09-29T13:51:59.991Z (2 months ago)
- Topics: containers, docker, gatsby, gatsbyjs, static-site, static-site-generator
- Language: Shell
- Homepage:
- Size: 19.5 KB
- Stars: 187
- Watchers: 3
- Forks: 53
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - gatsby-docker - Develop & Build GatsbyJS static sites within Docker. (Shell)
README
# gatsby-docker
Develop & Build [GatsbyJS](https://www.gatsbyjs.org/) static sites within a [Docker](https://www.docker.com/) 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`](http://gatsbyjs.github.io/gatsby-starter-default/) (unless already initialized)
- 👍 **Simple CLI API**: [`develop`/`stage`/`build`](#usage)
- 🆕 **Recent NodeJS**: Container based on [NodeJS `v9.5` running in Alpine Linux](https://github.com/nodejs/docker-node/blob/db3b27c8388136b5e529861d7c3fa12fd8328301/9/alpine/Dockerfile)
- 📃 [MIT](https://github.com/aripalo/gatsby-docker/blob/master/LICENSE)-licensed## 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
### Develop
```sh
docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 aripalo/gatsby-docker develop
```### Stage
In other words, build and serve:
```sh
docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 aripalo/gatsby-docker stage
```### Build
Builds production ready site into `site/public`:
```sh
docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 aripalo/gatsby-docker build
```### Run arbitary command inside the container
```sh
docker run -it --rm -v $(pwd)/site:/site -p 8000:8000 aripalo/gatsby-docker
```For example to install a new NPM-module: `docker run -it --rm -v $(pwd)/site:/site aripalo/gatsby-docker yarn add gatsby-transformer-yaml`