Skip to content

Commit 5015970

Browse files
committed
[documentation deploy] deploy docsify in docker.
1 parent b4b1033 commit 5015970

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

docs/deploy.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,54 @@ frontend:
135135
| /<*>.md | /<*>.md | 200 (Rewrite) |
136136
| /<*>.png | /<*>.png | 200 (Rewrite) |
137137
| /<*> | /index.html | 200 (Rewrite) |
138+
139+
140+
## Docker
141+
142+
>There is a simple demo for building docsify in docker.
143+
144+
?> tips: you can get all the files for this demo from [here](https://github.com/Koooooo-7/docsify-docker).
145+
146+
- Preparing Docsify initial files
147+
You need prepare the initial files (generated by run `docsify init ./docs`) instead of making in container.
148+
149+
```sh
150+
.nojekyll
151+
index.html
152+
README.md
153+
```
154+
155+
- Dockerfile
156+
157+
```Dockerfile
158+
FROM node:latest
159+
MAINTAINER Koooooo-7(https://github.com/Koooooo-7)
160+
LABEL description="A demo Dockerfile for build Docsify."
161+
WORKDIR /docs
162+
RUN npm install -g docsify-cli@latest
163+
EXPOSE 3000/tcp
164+
ENTRYPOINT docsify serve .
165+
166+
```
167+
168+
So, current directory structure should be this:
169+
170+
```sh
171+
.nojekyll
172+
index.html
173+
README.md
174+
Dockerfile
175+
```
176+
177+
- Build Image
178+
179+
```sh
180+
docker build -f Dockerfile -t docsify/demo .
181+
```
182+
183+
- Run
184+
185+
```sh
186+
docker run -itp 3000:3000 --name=docsify -v $(pwd):/docs docsify/demo
187+
```
188+

0 commit comments

Comments
 (0)