From 5f7f5736edabd40a0ab81ccf86714893d44596e7 Mon Sep 17 00:00:00 2001 From: Niraj Tolia Date: Thu, 19 May 2022 10:29:25 -0700 Subject: [PATCH] Add docs and commands to setup the container image (#49) --- docs/Dockerfile | 9 +++++++-- docs/README.md | 29 +++++++++++------------------ 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/docs/Dockerfile b/docs/Dockerfile index 89ba82144..9f588238d 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -3,8 +3,6 @@ LABEL MAINTAINER="Niraj Tolia" ARG DEBIAN_FRONTEND=noninteractive -WORKDIR /usr/src/docs - RUN apt-get -y update && apt-get -y install gpg emacs curl \ && curl -fsSL https://deb.nodesource.com/setup_current.x | bash - \ && apt-get -y install nodejs \ @@ -14,4 +12,11 @@ RUN apt-get -y update && apt-get -y install gpg emacs curl \ && cd /tmp && curl -O -L https://github.com/errata-ai/vale/releases/download/v2.15.4/vale_2.15.4_Linux_64-bit.tar.gz \ && tar -xvzf vale_2.15.4_Linux_64-bit.tar.gz -C /usr/bin vale +WORKDIR /usr/src +COPY package.json package-lock.json* ./ +RUN npm ci && npm cache clean --force && rm -f package.json package-lock.json* +ENV PATH /usr/src/node_modules/.bin:$PATH + +WORKDIR /usr/src/docs + CMD ["npm", "start", "--", "--host", "0.0.0.0"] diff --git a/docs/README.md b/docs/README.md index aaba2fa1e..1a8eadf29 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,41 +1,34 @@ -# Website +# Corso Documentation -This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. +Corso documentation is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. ### Installation ``` -$ yarn +$ make buildimage ``` -### Local Development +### Live Docs ``` -$ yarn start +$ make dev ``` -This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. +This command starts a local development server within the Docker container and will expose docs at http://localhost:3000. -### Build +### Build Docs ``` -$ yarn build +$ make build ``` This command generates static content into the `build` directory and can be served using any static contents hosting service. -### Deployment +### Documentation Platform Development -Using SSH: ``` -$ USE_SSH=true yarn deploy +$ make shell ``` -Not using SSH: - -``` -$ GIT_USER= yarn deploy -``` - -If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. +This command is when you want to interactively (and temporarily!) change the contents or configuration of the live documentation container image.