-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
root
committed
Jul 5, 2019
1 parent
b9288b8
commit 05ed0fc
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:8 | ||
|
||
RUN apt-get update && apt-get install -y net-tools vim telnet | ||
|
||
LABEL gateway.version=$VERSION | ||
LABEL gateway.build_date=$BUILD_DATE | ||
|
||
WORKDIR /usr/src/app | ||
|
||
ADD . . | ||
RUN npm install | ||
|
||
EXPOSE 3039 | ||
|
||
CMD npm run start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
################################################################### | ||
#Script Name : buildimage-configSvr.sh | ||
#Description : 用于给config server生成docker镜像,生成镜像后,可以手动执行下面一条指令启动容器 | ||
#Start container: docker run -d --name gateway -p 8081:8081 -p 8182:8182 -v /data/logs-gateway:/usr/src/app/log -v /opt/gateway/backend/config:/usr/src/app/config --link postgres:postgres 121.196.217.176:5000/gateway/gateway-backend:rc-1.0 | ||
#Args : BUILD_DATE - build date | ||
# VERSION - gateway version info | ||
#Author : invan | ||
#Email : [email protected] | ||
################################################################### | ||
|
||
VERSION_FILE='package.json' | ||
VERSION=V$(jq -r '.version' $VERSION_FILE) | ||
echo -e "start to build image cybex-config-server:${VERSION}" | ||
|
||
echo -e "1 remove exist image and container" | ||
docker stop cybex-config-server | ||
docker rm cybex-config-server | ||
docker rmi cybex-config-server:${VERSION} | ||
|
||
echo -e "2 build executable files" | ||
echo `pwd` | ||
git pull | ||
|
||
echo -e "3 build docker image" | ||
docker build --force-rm --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') --build-arg VERSION=$VERSION -t cybex-config-server:$VERSION -f ./Dockerfile . | ||
|
||
echo -e "---------------------------" | ||
echo -e "build cybex-config-server success" | ||
echo -e "---------------------------" |