Finish the comment things in the dockerfile and docker-compose.yml

This commit is contained in:
zicla
2018-01-30 12:10:11 +08:00
parent f5a0284932
commit 7ec6fb7090
2 changed files with 30 additions and 6 deletions

View File

@ -1,22 +1,26 @@
# 使用1.9的golang作为母镜像
FROM golang:1.9
# 维护者信息
# 维护者信息,也就是作者的姓名和邮箱
MAINTAINER eyeblue "eyebluecn@126.com"
# 指定工作目录就是 tank
# 指定工作目录就是 tank。工作目录指的就是以后 每层构建的当前目录 。
WORKDIR $GOPATH/src/tank
# 将tank项目下的所有文件移动到golang镜像中去
COPY . $GOPATH/src/tank
# 日志和上传文件目录
# 这里为了维持docker无状态性准备数据卷作为日志目录和上传文件目录
VOLUME /data/log
VOLUME /data/matter
# 通过环境变量的方式,为应用指定日志目录和上传文件目录。
ENV TANK_LOG_PATH=/data/log TANK_MATTER_PATH=/data/matter
# 开始下载依赖库并且进行编译
# golang.org库国内无法下载这里从我准备的github中clone
# github.com的库可以直接通过`go get`命令下载
# `go install tank`是对项目进行打包
# `cp`是将项目需要的html等文件移动到可执行文件的目录下。
RUN git clone https://github.com/eyebluecn/golang.org.git $GOPATH/src/golang.org \
&& go get github.com/disintegration/imaging \
&& go get github.com/json-iterator/go \
@ -26,8 +30,8 @@ RUN git clone https://github.com/eyebluecn/golang.org.git $GOPATH/src/golang.org
&& go install tank \
&& cp -r $GOPATH/src/tank/build/* $GOPATH/bin
# 暴露6010端口
# 声明运行时容器提供服务端口,这只是一个声明。默认是6010端口
EXPOSE 6010
# tank作为执行文件
# tank作为执行文件 启动这个容器就会去执行 `/go/bin/tank`
ENTRYPOINT ["/go/bin/tank"]