支持docker

pull/3/head
tanghc 4 years ago
parent ace5e1d5f6
commit 71d420c22e
  1. 2
      docker-build.sh
  2. 17
      docker-entrypoint.sh
  3. 2
      dockerfile
  4. 18
      sop-gateway/pom.xml
  5. 10
      sop-test/src/test/java/com/gitee/sop/test/AllInOneTest.java

@ -9,4 +9,4 @@ docker build -t gitee.com/sop .
image_id=`docker images gitee.com/sop --format "{{.ID}}" | awk '{print $1}'`
# 运行镜像
docker run --name sop -p 8081:8081 -p 8082:8082 -p 8083:8083 -p 2222:2222 -d $image_id
docker run --name sop -p 8081:8081 -p 8082:8082 -p 8083:8083 -p 8087:8087 -p 2222:2222 -d $image_id

@ -2,11 +2,12 @@
JAVA_OPTS="-Xms128m -Xmx128m"
CONF="--mysql.host=10.1.30.120:3306 --register.url=10.1.30.110:8848"
nohup java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-gateway/sop-gateway.jar $CONF --logging.file.path=/sop/sop-gateway/log > /dev/null 2>&1 &
nohup java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-admin/sop-admin.jar $CONF --logging.file.path=/sop/sop-admin/log > /dev/null 2>&1 &
nohup java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-website/sop-website.jar $CONF --logging.file.path=/sop/sop-website/log > /dev/null 2>&1 &
nohup java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-auth/sop-auth.jar $CONF --logging.file.path=/sop/sop-auth/log > /dev/null 2>&1 &
nohup java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-story/sop-story.jar $CONF --logging.file.path=/sop/sop-story/log > /dev/null 2>&1 &
# mysql, nacos配置
CONF="--mysql.host=10.1.30.110:3306 --register.url=10.1.30.110:8848"
java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-gateway/sop-gateway.jar $CONF --logging.file.path=/sop/sop-gateway/log &
java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-admin/sop-admin.jar $CONF --logging.file.path=/sop/sop-admin/log &
java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-website/sop-website.jar $CONF --logging.file.path=/sop/sop-website/log &
java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-auth/sop-auth.jar $CONF --logging.file.path=/sop/sop-auth/log &
# 最后一条没有&
java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /sop/sop-story/sop-story.jar $CONF --logging.file.path=/sop/sop-story/log

@ -5,7 +5,7 @@ VOLUME /sop
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
ADD sop-website/target/*.jar sop/sop-website/sop-website.jar
ADD sop-auth/target/*.jar sop/sop-website/sop-auth.jar
ADD sop-auth/target/*.jar sop/sop-auth/sop-auth.jar
ADD sop-example/sop-story/target/*.jar sop/sop-story/sop-story.jar
COPY docker-entrypoint.sh /usr/local/bin/

@ -95,24 +95,6 @@
<skipTests>true</skipTests>
</configuration>
</plugin>
<!-- docker插件
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<imageName>${project.groupId}/${project.artifactId}</imageName>
<dockerDirectory>src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
-->
</plugins>
</build>

@ -23,7 +23,7 @@ import java.util.Optional;
*/
public class AllInOneTest extends TestBase {
String url = "http://localhost:8081";
String url = "http://10.1.30.120:8081";
String appId = "2019032617262200001";
String privateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCXJv1pQFqWNA/++OYEV7WYXwexZK/J8LY1OWlP9X0T6wHFOvxNKRvMkJ5544SbgsJpVcvRDPrcxmhPb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t99v/ptDp9u8JTMC7penoryLKK0Ty3bkan95Kn9SC42YxaSghzqkt+uvfVQgiNGQKBgGxU6P2aDAt6VNwWosHSe+d2WWXt8IZBhO9d6dn0f7ORvcjmCqNKTNGgrkewMZEuVcliueJquR47IROdY8qmwqcBAN7Vg2K7r7CPlTKAWTRYMJxCT1Hi5gwJb+CZF3+IeYqsJk2NF2s0w5WJTE70k1BSvQsfIzAIDz2yE1oPHvwVAoGAA6e+xQkVH4fMEph55RJIZ5goI4Y76BSvt2N5OKZKd4HtaV+eIhM3SDsVYRLIm9ZquJHMiZQGyUGnsvrKL6AAVNK7eQZCRDk9KQz+0GKOGqku0nOZjUbAu6A2/vtXAaAuFSFx1rUQVVjFulLexkXR3KcztL1Qu2k5pB6Si0K/uwQ=";
@ -112,10 +112,16 @@ public class AllInOneTest extends TestBase {
*/
public void testJSR303() {
Client client = new Client(url, appId, privateKey);
Map<String, String> headers = new HashMap<>(8);
headers.put("accept-language", "zh-CN");
Client.RequestBuilder requestBuilder = new Client.RequestBuilder()
.method("goods.add")
.version("1.0")
.bizContent(new BizContent().add("goods_name", "iphone6").add("goods_remark", "iphone6").add("goods_comment", "1"))
.header(headers)
.bizContent(new BizContent()
.add("goods_name", "iphone6")
.add("goods_remark", "iphone6")
.add("goods_comment", "1"))
.httpMethod(HttpTool.HTTPMethod.POST)
.callback((requestInfo, responseData) -> {
System.out.println(responseData);

Loading…
Cancel
Save