[documdocs: deploy docsify in docker. (#1241)

* [documentation deploy] deploy docsify in docker.

* [remove] remove unnecessary content.

* [change] remove outbox resource link.

* [refine] refine description.

Co-authored-by: Anix <anik220798@gmail.com>
This commit is contained in:
Koy
2020-06-23 15:11:31 +08:00
committed by GitHub
parent c3d0d0d555
commit 4b02177cd2
+46
View File
@@ -135,3 +135,49 @@ frontend:
| /<*>.md | /<*>.md | 200 (Rewrite) |
| /<*>.png | /<*>.png | 200 (Rewrite) |
| /<*> | /index.html | 200 (Rewrite) |
## Docker
- Create docsify files
You need prepare the initial files instead of making in container.
See the [Quickstart](https://docsify.js.org/#/quickstart) section for instructions on how to create these files manually or using [docsify-cli](https://github.com/docsifyjs/docsify-cli).
```sh
index.html
README.md
```
- Create dockerfile
```Dockerfile
FROM node:latest
LABEL description="A demo Dockerfile for build Docsify."
WORKDIR /docs
RUN npm install -g docsify-cli@latest
EXPOSE 3000/tcp
ENTRYPOINT docsify serve .
```
So, current directory structure should be this:
```sh
index.html
README.md
Dockerfile
```
- Build docker image
```sh
docker build -f Dockerfile -t docsify/demo .
```
- Run docker image
```sh
docker run -itp 3000:3000 --name=docsify -v $(pwd):/docs docsify/demo
```