Skip to content

Commit 4b02177

Browse files
[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 <[email protected]>
1 parent c3d0d0d commit 4b02177

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

docs/deploy.md

+46
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,49 @@ frontend:
135135
| /<*>.md | /<*>.md | 200 (Rewrite) |
136136
| /<*>.png | /<*>.png | 200 (Rewrite) |
137137
| /<*> | /index.html | 200 (Rewrite) |
138+
139+
140+
## Docker
141+
142+
- Create docsify files
143+
144+
You need prepare the initial files instead of making in container.
145+
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).
146+
147+
```sh
148+
index.html
149+
README.md
150+
```
151+
152+
- Create dockerfile
153+
154+
```Dockerfile
155+
FROM node:latest
156+
LABEL description="A demo Dockerfile for build Docsify."
157+
WORKDIR /docs
158+
RUN npm install -g docsify-cli@latest
159+
EXPOSE 3000/tcp
160+
ENTRYPOINT docsify serve .
161+
162+
```
163+
164+
So, current directory structure should be this:
165+
166+
```sh
167+
index.html
168+
README.md
169+
Dockerfile
170+
```
171+
172+
- Build docker image
173+
174+
```sh
175+
docker build -f Dockerfile -t docsify/demo .
176+
```
177+
178+
- Run docker image
179+
180+
```sh
181+
docker run -itp 3000:3000 --name=docsify -v $(pwd):/docs docsify/demo
182+
```
183+

0 commit comments

Comments
 (0)