diff --git a/dockerfiles/n9e/Dockerfile b/dockerfiles/n9e/Dockerfile new file mode 100644 index 00000000..62739f0e --- /dev/null +++ b/dockerfiles/n9e/Dockerfile @@ -0,0 +1,12 @@ +FROM golang as builder +WORKDIR /home/n9e/builder +ENV GOPROXY=https://mirrors.aliyun.com/goproxy/ +RUN git clone https://hub.fastgit.org/didi/nightingale.git +RUN nightingale/control build + +FROM centos:7 +WORKDIR /home/n9e +COPY --from=builder /home/n9e/builder/nightingale/ . +COPY entrpoint.sh . +RUN yum install mysql net-tools -y +ENTRYPOINT ./entrpoint.sh diff --git a/dockerfiles/n9e/Dockerfile-n9e b/dockerfiles/n9e/Dockerfile-n9e deleted file mode 100644 index 250f312b..00000000 --- a/dockerfiles/n9e/Dockerfile-n9e +++ /dev/null @@ -1,7 +0,0 @@ -FROM centos:7 -WORKDIR /home/n9e -COPY entrpoint.sh . -ADD http://116.85.64.82/n9e-3.0.0.tar.gz . -RUN tar xvf n9e-3.0.0.tar.gz -RUN yum install mysql -y -ENTRYPOINT ./entrpoint.sh diff --git a/dockerfiles/n9e/entrpoint.sh b/dockerfiles/n9e/entrpoint.sh index dc1afd32..bfb3e650 100755 --- a/dockerfiles/n9e/entrpoint.sh +++ b/dockerfiles/n9e/entrpoint.sh @@ -2,13 +2,20 @@ sed -i 's/127.0.0.1/mysql/g' etc/mysql.yml sed -i 's/addr: 127.0.0.1:6379/addr: redis:6379/g' etc/rdb.yml -mysql -hmysql -uroot -p1234 < sql/n9e_ams.sql -mysql -hmysql -uroot -p1234 < sql/n9e_hbs.sql -mysql -hmysql -uroot -p1234 < sql/n9e_job.sql -mysql -hmysql -uroot -p1234 < sql/n9e_mon.sql -mysql -hmysql -uroot -p1234 < sql/n9e_rdb.sql -mysql -hmysql -uroot -p1234 < sql/n9e_rdb.sql -mysql -hmysql -uroot -p1234 < sql/n9e_rdb.sql +mysqlRootPassword=1234 + +until mysql -hmysql -u root -p$mysqlRootPassword -e ";" ; do + echo "Can't connect mysql, retry" + sleep 5 +done + +mysql -hmysql -uroot -p$mysqlRootPassword < sql/n9e_ams.sql +mysql -hmysql -uroot -p$mysqlRootPassword < sql/n9e_hbs.sql +mysql -hmysql -uroot -p$mysqlRootPassword < sql/n9e_job.sql +mysql -hmysql -uroot -p$mysqlRootPassword < sql/n9e_mon.sql +mysql -hmysql -uroot -p$mysqlRootPassword < sql/n9e_rdb.sql +mysql -hmysql -uroot -p$mysqlRootPassword < sql/n9e_rdb.sql +mysql -hmysql -uroot -p$mysqlRootPassword < sql/n9e_rdb.sql ./control start all sleep infinity diff --git a/dockerfiles/nginx/Dockerfile b/dockerfiles/nginx/Dockerfile index 9b312c85..579b4bb6 100644 --- a/dockerfiles/nginx/Dockerfile +++ b/dockerfiles/nginx/Dockerfile @@ -1,6 +1,5 @@ FROM nginx WORKDIR /home/n9e -COPY nginx.sh . COPY nginx.conf /etc/nginx ADD http://116.85.64.82/pub.20200928.tar.gz . RUN tar xvf pub.20200928.tar.gz