Skip to content

Commit

Permalink
Add Dockerfile for building the website (#699)
Browse files Browse the repository at this point in the history
* Add Dockerfile for building the website

This Dockerfile was taken from spaCy.

* README: Remove command substitution in example
  • Loading branch information
danieldk authored Jun 15, 2022
1 parent cde169b commit 2ae2125
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
16 changes: 16 additions & 0 deletions website/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:11.15.0

WORKDIR /thinc-io

RUN npm install -g gatsby-cli@2.7.4

COPY package.json .
COPY package-lock.json .

RUN npm install

# This is so the installed node_modules will be up one directory
# from where a user mounts files, so that they don't accidentally mount
# their own node_modules from a different build
# https://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders
WORKDIR /thinc-io/website/
24 changes: 24 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,30 @@ npm run dev # start dev server
A `.prettierrc` is included in the repo, so if you set up auto-formatting with
Prettier, it should match the style.

## Build and run the website in a Docker container

Rather than installing NPM locally, you can also build a Docker container with
the prerequisite dependencies:

```bash
docker build -t thinc-io .
```

Afterwards, the website can be built and run in the container:

```bash
docker run --rm -it \
-v $PWD:/thinc-io/website \
-p 8000:8000 \
thinc-io \
gatsby develop -H 0.0.0.0
```

This is currently the only way to build the website on ARM64 Macs, since the
required Node.js version is not built for macOS/ARM64.

These commands also work with Podman by replacing `docker` by `podman`.

## Directory structure

- `/docs`: Docs pages as Markdown.
Expand Down

0 comments on commit 2ae2125

Please sign in to comment.