Skip to content

Commit 2ae2125

Browse files
authored
Add Dockerfile for building the website (#699)
* Add Dockerfile for building the website This Dockerfile was taken from spaCy. * README: Remove command substitution in example
1 parent cde169b commit 2ae2125

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

website/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM node:11.15.0
2+
3+
WORKDIR /thinc-io
4+
5+
RUN npm install -g [email protected]
6+
7+
COPY package.json .
8+
COPY package-lock.json .
9+
10+
RUN npm install
11+
12+
# This is so the installed node_modules will be up one directory
13+
# from where a user mounts files, so that they don't accidentally mount
14+
# their own node_modules from a different build
15+
# https://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders
16+
WORKDIR /thinc-io/website/

website/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,30 @@ npm run dev # start dev server
1414
A `.prettierrc` is included in the repo, so if you set up auto-formatting with
1515
Prettier, it should match the style.
1616

17+
## Build and run the website in a Docker container
18+
19+
Rather than installing NPM locally, you can also build a Docker container with
20+
the prerequisite dependencies:
21+
22+
```bash
23+
docker build -t thinc-io .
24+
```
25+
26+
Afterwards, the website can be built and run in the container:
27+
28+
```bash
29+
docker run --rm -it \
30+
-v $PWD:/thinc-io/website \
31+
-p 8000:8000 \
32+
thinc-io \
33+
gatsby develop -H 0.0.0.0
34+
```
35+
36+
This is currently the only way to build the website on ARM64 Macs, since the
37+
required Node.js version is not built for macOS/ARM64.
38+
39+
These commands also work with Podman by replacing `docker` by `podman`.
40+
1741
## Directory structure
1842

1943
- `/docs`: Docs pages as Markdown.

0 commit comments

Comments
 (0)