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

[documentation (deploy)] deploy docsify in docker. #1241

Merged
merged 5 commits into from
Jun 23, 2020
Merged
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
46 changes: 46 additions & 0 deletions docs/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```