Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dockerfile #844

Merged
merged 2 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions website/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Avoid uploading large Docker contexts
.cache/
public/
node_modules
.npm
logs
*.log
npm-debug.log*
www/
_deploy.sh
*.html
18 changes: 8 additions & 10 deletions website/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
FROM node:11.15.0
FROM node:16

WORKDIR /thinc-ai

RUN npm install -g gatsby-cli@2.7.4

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

RUN npm install
USER node

# 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-ai/website/
WORKDIR /home/node
COPY --chown=node package.json .
COPY --chown=node package-lock.json .
RUN npm install

WORKDIR /home/node/website/
4 changes: 2 additions & 2 deletions website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ Afterwards, the website can be built and run in the container:

```bash
docker run --rm -it \
-v $PWD:/thinc-ai/website \
-v $PWD:/home/node/website \
-p 8000:8000 \
thinc-ai \
gatsby develop -H 0.0.0.0
npm run dev -- -H 0.0.0.0
```

This is currently the only way to build the website on ARM64 Macs, since the
Expand Down