From 2a8fbb7b862a503f64ad98ff7e667e4ae0b70fbb Mon Sep 17 00:00:00 2001 From: zicla Date: Mon, 29 Jan 2018 16:53:10 +0800 Subject: [PATCH] Refine the whole docker config. --- Dockerfile | 11 +++++++++-- build/conf/tank.json | 2 +- docker-compose.yml | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c2648ca..7a24f80 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,10 +11,17 @@ WORKDIR $GOPATH/src/tank COPY . $GOPATH/src/tank # 开始编译 -RUN ./build/pack/build.sh +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 \ + && go get github.com/go-sql-driver/mysql \ + && go get github.com/jinzhu/gorm \ + && go get github.com/nu7hatch/gouuid \ + && go install tank \ + && cp -r $GOPATH/src/tank/build/* $GOPATH/bin # 暴露6010端口 EXPOSE 6010 # tank作为执行文件 -ENTRYPOINT ["/go/src/tank/dist/tank-1.0.2/tank"] +ENTRYPOINT ["/go/bin/tank"] diff --git a/build/conf/tank.json b/build/conf/tank.json index cebbe6f..f216409 100644 --- a/build/conf/tank.json +++ b/build/conf/tank.json @@ -2,7 +2,7 @@ "ServerPort": 6010, "LogToConsole": false, "MysqlPort": 3306, - "MysqlHost": "db", + "MysqlHost": "127.0.0.1", "MysqlSchema": "tank", "MysqlUserName": "tank", "MysqlPassword": "tank123", diff --git a/docker-compose.yml b/docker-compose.yml index 94ead15..7616553 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,6 +14,7 @@ services: tank: build: . + image: tank:1.0.2 depends_on: - db ports: