Skip to content

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

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

Merged
merged 5 commits into from
Jun 23, 2020
Merged
Changes from 3 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
48 changes: 48 additions & 0 deletions docs/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,51 @@ frontend:
| /<*>.md | /<*>.md | 200 (Rewrite) |
| /<*>.png | /<*>.png | 200 (Rewrite) |
| /<*> | /index.html | 200 (Rewrite) |


## Docker

>There is a simple demo for building docsify in docker.
Copy link
Member

Choose a reason for hiding this comment

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

Can we remove this? I'm not sure why this is here (or why it's formatted using a blockquote)

Copy link
Member Author

Choose a reason for hiding this comment

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

yep, it is unnecessary.


?> tips: you can create all the files for this demo from [Quickstart](https://docsify.js.org/#/quickstart?id=initialize).
Copy link
Member

Choose a reason for hiding this comment

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

The link to the Quickstart should be provided under the docsify bullet below, not above it. Otherwise, this tip implies "all of the files for this demo" including a docker file, which the Quickstart section does not discuss. Recommend removing this and just adding a link (not a tip) under the docsify bullet below.


- Preparing Docsify initial files
Copy link
Member

Choose a reason for hiding this comment

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

Making bullet names consistent: "Create docsify files"

You need prepare the initial files (generated by run `docsify init ./docs`) instead of making in container.
Copy link
Member

Choose a reason for hiding this comment

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

To prevent outdated instructions here, let's just refer people to the Quickstart guide: "See the Quickstart section for instructions on how to create these files manually or using docsify-cli."

(Quickstart section and docsify-cli should be linked)


```sh
index.html
README.md
```

- Dockerfile
Copy link
Member

Choose a reason for hiding this comment

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

Making bullet names consistent: "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 Image
Copy link
Member

Choose a reason for hiding this comment

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

Making bullet names consistent: "Build docker image"


```sh
docker build -f Dockerfile -t docsify/demo .
```

- Run
Copy link
Member

Choose a reason for hiding this comment

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

Making bullet names consistent: "Run docker image"


```sh
docker run -itp 3000:3000 --name=docsify -v $(pwd):/docs docsify/demo
```