|
1 | 1 | # docker-gitbook
|
2 | 2 |
|
3 |
| -[](https://hub.docker.com/r/yanqd0/gitbook/builds/) |
4 |
| -[](https://hub.docker.com/r/yanqd0/gitbook/builds/) |
| 3 | +[](https://hub.docker.com/r/yanqd0/gitbook/builds/) |
| 4 | +[](https://hub.docker.com/r/yanqd0/gitbook/builds/) |
5 | 5 | [](https://hub.docker.com/r/yanqd0/gitbook/)
|
6 | 6 | [](https://hub.docker.com/r/yanqd0/gitbook/)
|
7 | 7 |
|
| 8 | +The smallest gitbook docker image built from Alpine. |
| 9 | + |
| 10 | +## Install |
| 11 | + |
| 12 | +```sh |
| 13 | +docker pull yanqd0/gitbook |
| 14 | +``` |
| 15 | + |
| 16 | +## Usage |
| 17 | + |
| 18 | +There are two simple ways to use it, `docker run` or `docker-compose up`. |
| 19 | + |
| 20 | +In the gitbook project, execute `docker` commands. |
| 21 | + |
| 22 | +```sh |
| 23 | +docker run -v $PWD:/srv/gitbook -p 4000:4000 yanqd0/gitbook |
| 24 | +``` |
| 25 | + |
| 26 | +I never run it like this, except for debug. I always prefer [docker-compose], which can be easily [installed] and used. |
| 27 | + |
| 28 | +You can write your `docker-compose.yml` like this: |
| 29 | + |
| 30 | +```yaml |
| 31 | +version: '2' |
| 32 | +services: |
| 33 | + gitbook: |
| 34 | + image: yanqd0/gitbook |
| 35 | + volumes: |
| 36 | + - .:/srv/gitbook |
| 37 | + ports: |
| 38 | + - 4000:4000 |
| 39 | +``` |
| 40 | +
|
| 41 | +And then, run `docker-compose up`. |
| 42 | + |
| 43 | +There is a verified [example.docker-compose.yml]. |
| 44 | + |
8 | 45 | [](https://travis-ci.org/yanqd0/docker-gitbook)
|
9 | 46 |
|
10 |
| -An unofficial gitbook docker image built from Alpine. |
| 47 | +[docker-compose]:https://github.com/docker/compose |
| 48 | +[installed]:https://docs.docker.com/compose/install/ |
| 49 | +[example.docker-compose.yml]:https://github.com/yanqd0/docker-gitbook/blob/master/example.docker-compose.yml |
11 | 50 |
|
12 |
| -This repository is inspired by [fellah/gitbook](https://hub.docker.com/r/fellah/gitbook/~/dockerfile/). |
| 51 | +## Version |
| 52 | + |
| 53 | +| Name | Version | |
| 54 | +| ---- | ------- | |
| 55 | +| node | 7.9.0 | |
| 56 | +| npm | 4.2.0 | |
| 57 | +| GitBook CLI | 2.3.0 | |
| 58 | +| GitBook | 3.2.2 | |
13 | 59 |
|
14 | 60 | ## License
|
15 | 61 |
|
16 |
| -[](LICENSE) |
| 62 | +[](https://github.com/yanqd0/docker-gitbook/blob/master/LICENSE) |
| 63 | + |
| 64 | +This repository is inspired by [fellah/gitbook]. |
| 65 | + |
| 66 | +The base image is changed to Alpine [node], which makes it much smaller. |
| 67 | +The CMD is changed to `gitbook install && gitbook serve`, which will install [GitBook Plugins] before served. |
17 | 68 |
|
18 | 69 | > The MIT License (MIT)
|
19 | 70 | >
|
20 | 71 | > Copyright (c) 2017 [email protected]
|
| 72 | + |
| 73 | +[fellah/gitbook]:https://hub.docker.com/r/fellah/gitbook/~/dockerfile/ |
| 74 | +[node]:https://hub.docker.com/_/node/ |
| 75 | +[GitBook Plugins]:https://plugins.gitbook.com/ |
0 commit comments