Skip to content

Commit 5cac06d

Browse files
authored
Merge pull request #1688 from docsifyjs/docker-local
test: for making test steady in docker locally.
2 parents 40e7749 + aa91d9e commit 5cac06d

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Diff for: Dockerfile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM mcr.microsoft.com/playwright:focal
2+
WORKDIR /app
3+
COPY . .
4+
RUN rm package-lock.json
5+
RUN npm install
6+
RUN npx playwright install
7+
RUN npm run build
8+
ENTRYPOINT ["npm", "run"]
9+
CMD ["test"]

Diff for: package.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@
4343
"prepare": "npm run build",
4444
"pub:next": "cross-env RELEASE_TAG=next sh build/release.sh",
4545
"pub": "sh build/release.sh",
46-
"postinstall": "opencollective-postinstall"
46+
"postinstall": "opencollective-postinstall",
47+
"docker:build": "docker build -f Dockerfile -t docsify-test:local .",
48+
"docker:clean": "docker rmi docsify-test:local",
49+
"docker:rebuild": "npm run docker:clean && npm run docker:build",
50+
"docker:test": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test",
51+
"docker:test:e2e": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:e2e",
52+
"docker:test:integration": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:integration",
53+
"docker:test:unit": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:unit"
4754
},
4855
"husky": {
4956
"hooks": {

0 commit comments

Comments
 (0)