Merge pull request #223 from xiongsp/master

feat: update Dockerfile to deploy
pull/247/head
Yudong Jin 2 years ago committed by GitHub
commit abcdf1b234
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,16 @@
FROM python:3.9.0-alpine
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple mkdocs-material==9.0.2
WORKDIR /app
COPY codes /app/codes
COPY docs /app/docs
COPY mkdocs.yml /app/mkdocs.yml
RUN mkdir ./docs/overrides && mkdocs build
EXPOSE 8000
CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"]

@ -0,0 +1,7 @@
version: '3'
services:
hello-algo:
build: .
ports:
- "8000:8000"

@ -41,4 +41,26 @@ comments: true
非常欢迎您和我一同来创作本书!
## 离线部署
### Docker
使用本教程前,请确保 Docker 已经安装并启动。
根据如下命令离线部署。
```bash
git clone https://github.com/krahets/hello-algo.git
cd hello-algo
docker-compose up -d
```
稍等片刻,即可通过浏览器打开 `http://localhost:8000` 访问本教程。
使用如下命令删除部署。
```bash
docker-compose down
```
TODO教学视频

Loading…
Cancel
Save