归档 0.8 版本,增加离线阅读

This commit is contained in:
khs1994
2017-11-22 22:06:02 +08:00
parent c8260780d9
commit 2535813859
7 changed files with 111 additions and 0 deletions

26
.travis/Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
FROM node:9-alpine
ENV TZ=Asia/Shanghai
WORKDIR /srv/gitbook
COPY book.json book.json
COPY docker-entrypoint.sh /usr/local/bin/
RUN apk add --no-cache \
tzdata \
&& npm install -g gitbook-cli \
&& gitbook install \
&& ln -s /usr/local/bin/docker-entrypoint.sh / \
&& rm -rf /root/.npm /tmp/*
EXPOSE 4000
VOLUME /srv/gitbook-src
WORKDIR /srv/gitbook-src
ENTRYPOINT ["docker-entrypoint.sh"]
CMD server

30
.travis/book.json Normal file
View File

@@ -0,0 +1,30 @@
{
"title": "Docker -- 从入门到实践",
"author": "yeasy",
"plugins": [
"image-captions",
"github-buttons",
"page-treeview"
],
"pluginsConfig": {
"image-captions": {
"attributes": {
"width": "600"
},
"caption": "图 _PAGE_LEVEL_._PAGE_IMAGE_NUMBER_ - _CAPTION_"
},
"github-buttons": {
"repo": "yeasy/docker_practice",
"types": [
"star",
"watch"
],
"size": "small"
},
"page-treeview": {
"copyright": "Copyright © yeasy",
"minHeaderCount": "2",
"minHeaderDeep": "2"
}
}
}

View File

@@ -0,0 +1,5 @@
sut:
build: .
volumes:
- ../:/srv/gitbook-src
command: build

19
.travis/docker-entrypoint.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
START=`date "+%F %T"`
if [ $1 = "sh" ];then sh ; exit 0; fi
rm -rf node_modules _book
cp -a . ../gitbook
cd ../gitbook
main(){
if [ "$1" = build ];then gitbook build; cp -a _book ../gitbook-src; echo $START; date "+%F %T"; exit 0; fi
gitbook serve
exit 0
}
main $1 $2 $3

8
.travis/update.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
# cd .travis
# ./update.sh
if [ ! -f Dockerfile ];then exit 1; fi
cp -a ../book.json book.json

View File

@@ -15,6 +15,18 @@
* pdf 版本 [下载](https://www.gitbook.com/download/pdf/book/yeasy/docker_practice)
* epub 版本 [下载](https://www.gitbook.com/download/epub/book/yeasy/docker_practice)
离线阅读:
```bash
$ git clone -b bump-0.8 --depth=1 https://github.com/yeasy/docker_practice.git
$ cd docker_practice
$ docker-compose pull # 如果您位于国外,这一步请改为 $ docker-compose build
$ docker-compose up
```
Docker 自身仍在快速发展中,生态环境也在蓬勃成长。欢迎参与维护项目:[如何贡献](contribute.md)。
* [修订记录](revision.md)

11
docker-compose.yml Normal file
View File

@@ -0,0 +1,11 @@
version: "3"
services:
docker_practice:
build: ./.travis
image: ccr.ccs.tencentyun.com/docker_practice/docker_practice:latest
ports:
- 4000:4000
volumes:
- ./:/srv/gitbook-src
command: server