mirror of
https://github.com/yeasy/docker_practice.git
synced 2025-08-03 22:42:08 +00:00
26
.travis/Dockerfile
Normal file
26
.travis/Dockerfile
Normal 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
30
.travis/book.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
5
.travis/docker-compose.test.yml
Normal file
5
.travis/docker-compose.test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
sut:
|
||||
build: .
|
||||
volumes:
|
||||
- ../:/srv/gitbook-src
|
||||
command: build
|
19
.travis/docker-entrypoint.sh
Executable file
19
.travis/docker-entrypoint.sh
Executable 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
8
.travis/update.sh
Executable 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
|
Reference in New Issue
Block a user