Merge pull request #1688 from docsifyjs/docker-local

test: for making test steady in docker locally.
This commit is contained in:
Joe Pea 2022-01-03 22:18:48 -08:00 committed by GitHub
commit 5cac06dd9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM mcr.microsoft.com/playwright:focal
WORKDIR /app
COPY . .
RUN rm package-lock.json
RUN npm install
RUN npx playwright install
RUN npm run build
ENTRYPOINT ["npm", "run"]
CMD ["test"]

View File

@ -43,7 +43,14 @@
"prepare": "npm run build", "prepare": "npm run build",
"pub:next": "cross-env RELEASE_TAG=next sh build/release.sh", "pub:next": "cross-env RELEASE_TAG=next sh build/release.sh",
"pub": "sh build/release.sh", "pub": "sh build/release.sh",
"postinstall": "opencollective-postinstall" "postinstall": "opencollective-postinstall",
"docker:build": "docker build -f Dockerfile -t docsify-test:local .",
"docker:clean": "docker rmi docsify-test:local",
"docker:rebuild": "npm run docker:clean && npm run docker:build",
"docker:test": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test",
"docker:test:e2e": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:e2e",
"docker:test:integration": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:integration",
"docker:test:unit": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:unit"
}, },
"husky": { "husky": {
"hooks": { "hooks": {