Commit 05313a15 by 朽木不可雕也

添加docker

parent 3e0a4f02
FROM openjdk:8
WORKDIR /root
COPY bootstrap/target/automatic-test-jar-with-dependencies.jar automatic-test-jar-with-dependencies.jar
ENV TZ=Asia/Shanghai
ENTRYPOINT ["java", "-Xms512M", "-Xmx512M", "-jar", "automatic-test-jar-with-dependencies.jar"]
\ No newline at end of file
...@@ -16,7 +16,7 @@ public class BaseConfig { ...@@ -16,7 +16,7 @@ public class BaseConfig {
/** /**
* 接口的基础url * 接口的基础url
*/ */
public static final String BASE_URL = "http://192.168.0.119:8080/barrage-crawler-server"; public static final String BASE_URL = "http://barrage-crawler-server:8080/barrage-crawler-server";
/** /**
* 采集任务接口 * 采集任务接口
*/ */
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<dataSource type="com.zhiweidata.automatictest.publics.HikariDataSourceFactory"> <dataSource type="com.zhiweidata.automatictest.publics.HikariDataSourceFactory">
<property name="driver" value="com.mysql.cj.jdbc.Driver"/> <property name="driver" value="com.mysql.cj.jdbc.Driver"/>
<property name="url" <property name="url"
value="jdbc:mysql://192.168.0.119:3306/automatic_test?useSSL=FALSE&amp;serverTimezone=Asia/Shanghai"/> value="jdbc:mysql://mysqld:3306/automatic_test?useSSL=FALSE&amp;serverTimezone=Asia/Shanghai"/>
<property name="username" value="root"/> <property name="username" value="root"/>
<property name="password" value="z199809051593"/> <property name="password" value="z199809051593"/>
</dataSource> </dataSource>
......
#!/bin/zsh
name="automatic-test"
alias docker_local="docker -H 192.168.0.119"
if mvn clean package -Dmaven.test.skip=true; then
docker_local container stop ${name}
docker_local container rm ${name}
docker_local image rm ${name}
docker_local build -t ${name} .
docker_local container run -d -t --name=${name} -m=512M --memory-swap=-1 \
--link barrage-crawler-server:barrage-crawler-server \
--link mysqld:mysqld \
${name}
fi
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment