diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..a091fcb6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:alpine + +RUN apk update && \ + apk add --update --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing \ + g++ \ + git \ + make \ + bash \ + python \ + && rm -rf /var/cache/apk/* + +RUN mkdir -p /docs +WORKDIR /docs + +COPY package.json . + +RUN npm install && npm cache clean --force diff --git a/README.md b/README.md index d5f9246c..61c6057a 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ - [Adding docs](#adding-docs) - [Repositories](#repositories) - [Development](#development) + - [Use Docker](#use-docker) - [Authors](#authors) - [License](#license) @@ -76,7 +77,12 @@ The repositories list is currently sourced from the [`/data/repositories.yml`](d The site is a React app built with [Gatsby](https://www.gatsbyjs.org), pulling its content from various sources. -To start development, clone this repo, install all dependencies, and start the development server: +As a prerequisite you'll need on your machine: + +- Node.js +- npm + +Clone this repo, install all dependencies, and start the development server: ```bash git clone git@github.com:oceanprotocol/docs.git @@ -88,6 +94,21 @@ npm start This will start a hot-reloading local server exposed under [localhost:8000](http://localhost:8000). +### Use Docker + +Alternatively, you can use Docker for which you need to have installed on your machine: + +- [Docker](https://www.docker.com) +- [Docker Compose](https://docs.docker.com/compose/) + +Then use Compose to bring everything up: + +```bash +docker-compose up +``` + +This will expose a hot-reloading server under [localhost:8000](http://localhost:8000). + ## Authors - Troy McConaghy ([@ttmc](https://github.com/ttmc)) - [Ocean Protocol](https://oceanprotocol.com) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..fa930e04 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3' +services: + gatsby: + build: . + command: ./node_modules/gatsby/dist/bin/gatsby.js develop --host 0.0.0.0 + volumes: + - .:/docs + - /docs/node_modules + ports: + - '8000:8000'