Add more things into Dockerfile.

This commit is contained in:
hxsherry 2018-01-28 22:36:50 +08:00
parent 84df8567c5
commit 4bc97394dc
2 changed files with 22 additions and 7 deletions

View File

@ -1,14 +1,19 @@
# 使用最新的golang作为母镜像 # 使用1.8的golang作为母镜像
FROM golang:latest FROM golang:1.8
# 维护者信息 # 维护者信息
MAINTAINER eyeblue "eyebluecn@126.com" MAINTAINER eyeblue "eyebluecn@126.com"
WORKDIR $GOPATH/src/hellodocker # 指定工作目录就是 tank
ADD . $GOPATH/src/hellodocker WORKDIR $GOPATH/src/tank
RUN go build .
# 将tank项目下的所有文件移动到golang镜像中去
ADD . $GOPATH/src/tank
EXPOSE 8080 # 开始编译
RUN ./build/pack/build.sh
ENTRYPOINT ["./hellodocker"] # 暴露6010端口
EXPOSE 6010
ENTRYPOINT ["../../bin/tank"]

10
docker-compose.yml Normal file
View File

@ -0,0 +1,10 @@
version: '3'
services:
web:
build: .
ports:
- "5000:5000"
redis:
image: "redis:alpine"