diff --git a/dockerfile b/dockerfile index 3d585900..7ed256b7 100644 --- a/dockerfile +++ b/dockerfile @@ -2,6 +2,18 @@ FROM java:8 VOLUME /tmp VOLUME /sop +COPY sop.sql sop.sql + +# 安装mysql +RUN yum install mysql mysql-server +RUN /etc/init.d/mysqld start &&\ +mysql -e "grant all privileges on *.* to 'root'@'%' identified by 'root';" &&\ +mysql -e "grant all privileges on *.* to 'root'@'localhost' identified by 'root';" +EXPOSE 3306 +CMD ["mysqld_safe"] + +CMD mysql -uroot -proot mysql < sop.sql + # 将所有应用放到一个镜像当中 ADD sop-gateway/target/*.jar sop/sop-gateway/sop-gateway.jar ADD sop-admin/sop-admin-server/target/*.jar sop/sop-admin/sop-admin.jar