mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-14 05:37:03 +03:00
dockerfile and build instructions
add docker registry reference
This commit is contained in:
parent
d5072c8315
commit
f97819c6cf
16
website/Dockerfile
Normal file
16
website/Dockerfile
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
FROM node:11.15.0
|
||||||
|
|
||||||
|
WORKDIR /spacy-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 /spacy-io/website/
|
|
@ -554,6 +554,40 @@ extensions for your code editor. The
|
||||||
[`.prettierrc`](https://github.com/explosion/spaCy/tree/master/website/.prettierrc)
|
[`.prettierrc`](https://github.com/explosion/spaCy/tree/master/website/.prettierrc)
|
||||||
file in the root defines the settings used in this codebase.
|
file in the root defines the settings used in this codebase.
|
||||||
|
|
||||||
|
## Building & Developing the Site with Docker {#docker}
|
||||||
|
Sometimes it's hard to get a local environment working due to rapid updates to node dependencies,
|
||||||
|
so it may be easier to use docker for building the docs.
|
||||||
|
|
||||||
|
If you'd like to do this,
|
||||||
|
**be sure you do *not* include your local `node_modules` folder**,
|
||||||
|
since there are some dependencies that need to be built for the image system.
|
||||||
|
Rename it before using.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -it \
|
||||||
|
-v $(pwd):/spacy-io/website \
|
||||||
|
-p 8000:8000 \
|
||||||
|
ghcr.io/explosion/spacy-io \
|
||||||
|
gatsby develop -H 0.0.0.0
|
||||||
|
```
|
||||||
|
|
||||||
|
This will allow you to access the built website at http://0.0.0.0:8000/
|
||||||
|
in your browser, and still edit code in your editor while having the site
|
||||||
|
reflect those changes.
|
||||||
|
|
||||||
|
**Note**: On M1 Macs you may need to the image tagged `arm64` (`ghcr.io/explosion/spacy-io:arm64`),
|
||||||
|
otherwise you'll see `qemu` segfault during the build.
|
||||||
|
|
||||||
|
### Building the Docker Image {#docker-build}
|
||||||
|
|
||||||
|
If you'd like to build the image locally, you can do so like this:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker build -t spacy-io .
|
||||||
|
```
|
||||||
|
|
||||||
|
This will take some time, so if you want to use the prebuilt image you'll save a bit of time.
|
||||||
|
|
||||||
## Markdown reference {#markdown}
|
## Markdown reference {#markdown}
|
||||||
|
|
||||||
All page content and page meta lives in the `.md` files in the `/docs`
|
All page content and page meta lives in the `.md` files in the `/docs`
|
||||||
|
|
Loading…
Reference in New Issue
Block a user