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

Docker build cleanup #648

Merged
merged 3 commits into from Apr 2, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 8 additions & 15 deletions .dockerignore
@@ -1,15 +1,8 @@
node_modules
.github
bench
test
images
lib
.clinic
.nyc_output
coverage
docs
docsify
types
.husky
examples
benchmarks
# Ignore everything but the stuff following the `*` with the `!`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted for a "exclude everything" by default. It keeps the list shorter.

# See https://docs.docker.com/engine/reference/builder/#dockerignore-file

*
!package.json
!lib
!deps
!build
5 changes: 4 additions & 1 deletion build/Dockerfile
Expand Up @@ -15,7 +15,10 @@ RUN mkdir /home/node/undici

WORKDIR /home/node/undici

COPY . .
COPY package.json .
COPY build build
COPY deps deps
COPY lib lib

RUN npm i

Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -28,16 +28,16 @@
"docs"
],
"scripts": {
"prebuild-wasm": "docker build -t llhttp_wasm_builder -f build/Dockerfile .",
"build-wasm": "node build/wasm.js --docker",
"prebuild:wasm": "docker build -t llhttp_wasm_builder -f build/Dockerfile .",
"build:wasm": "node build/wasm.js --docker",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took the liberty of renaming the scripts to make them more consistent.

"lint": "standard | snazzy",
"test": "tap test/*.js --no-coverage && jest test/jest/test",
"test:typescript": "tsd",
"coverage": "standard | snazzy && tap test/*.js",
"coverage:ci": "npm run coverage -- --coverage-report=lcovonly",
"prebench": "node -e \"try { require('fs').unlinkSync(require('path').join(require('os').tmpdir(), 'undici.sock')) } catch (_) {}\"",
"bench": "npx concurrently -k -s first \"node benchmarks/server.js\" \"node -e 'setTimeout(() => {}, 1000)' && node benchmarks\"",
"serve-website": "docsify serve .",
"serve:website": "docsify serve .",
"prepare": "husky install"
},
"devDependencies": {
Expand Down