Skip to content

Commit 09c8bac

Browse files
authored
Run in a docker container (#140)
1 parent e511fed commit 09c8bac

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Diff for: Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM node:alpine
2+
RUN npm i docsify-cli -g
3+
COPY . /data
4+
WORKDIR /data
5+
CMD [ "docsify", "serve", "docs" ]

Diff for: docs/README.md

+18
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,24 @@ cd Dive-into-DL-PyTorch
3434
docsify serve docs
3535
```
3636

37+
### 方法三
38+
如果你不想安装`docsify-cli`工具,甚至你的电脑上都没有安装`Node.js`,而出于某些原因你又想在本地浏览文档,那么你可以在`docker`容器中运行网页服务。
39+
40+
首先将本项目clone到本地:
41+
``` shell
42+
git clone https://github.com/ShusenTang/Dive-into-DL-PyTorch.git
43+
cd Dive-into-DL-PyTorch
44+
```
45+
之后使用如下命令创建一个名称为「d2dl」的`docker`镜像:
46+
``` shell
47+
docker build -t d2dl .
48+
```
49+
镜像创建好后,运行如下命令创建一个新的容器:
50+
``` shell
51+
docker run -dp 3000:3000 d2dl
52+
```
53+
最后在浏览器中打开这个地址`http://localhost:3000/#/`,就能愉快地访问文档了。适合那些不想在电脑上装太多工具的小伙伴。
54+
3755

3856
## 目录
3957
* [简介]()

0 commit comments

Comments
 (0)