tsurumure 1 anno fa
parent
commit
743999b9fb
3 ha cambiato i file con 28 aggiunte e 26 eliminazioni
  1. 3 1
      Dockerfile
  2. 2 2
      docker-compose.yml
  3. 23 23
      pom.xml

+ 3 - 1
Dockerfile

@@ -6,7 +6,9 @@ ADD ./target/backendsys-1.0.0.jar /app/build/backendsys-1.0.0.jar
 #ADD ./libs/ /app/build/libs/
 
 EXPOSE 48080
-ENTRYPOINT ["nohup", "java", "-jar", "/app/build/backendsys-1.0.0.jar & > /app/build/backendsys.log &"]
+ENTRYPOINT ["nohup", "java", "-jar", "/app/build/backendsys-1.0.0.jar"]
+#ENTRYPOINT ["sh", "-c", "nohup java -jar /app/build/backendsys-1.0.0.jar > /app/build/backendsys.log &"]
+
 
 #"-Dloader.path=/app/build/libs",
 

+ 2 - 2
docker-compose.yml

@@ -21,5 +21,5 @@ services:
       - TZ="Asia/Shanghai"
     #启动容器后执行的命令
 #    entrypoint: ["sh", "-c", "nohup java -Dloader.path=/app/build/libs -jar /app/build/backendsys-1.0.0.jar > /app/build/backendsys.log &"]
-    entrypoint: nohup java -jar /app/build/backendsys-1.0.0.jar > /app/build/backendsys.log &
-    # -Dloader.path=/app/build/libs"
+    entrypoint: nohup java -Dloader.path=/app/build/libs -jar /app/build/backendsys-1.0.0.jar
+    # -Dloader.path=/app/build/libs

+ 23 - 23
pom.xml

@@ -466,34 +466,34 @@
         <plugins>
 
             <!-- 如果不分包,则此处必填2 -->
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-            </plugin>
-
-            <!-- 创建一个不包含依赖的jar包 -->
 <!--            <plugin>-->
 <!--                <groupId>org.springframework.boot</groupId>-->
 <!--                <artifactId>spring-boot-maven-plugin</artifactId>-->
-<!--                <configuration>-->
-<!--                    <mainClass>com.backendsys.Application</mainClass>-->
-<!--                    <layout>ZIP</layout>-->
-<!--                    <includes>-->
-<!--                        <include>-->
-<!--                            <groupId>nothing</groupId>-->
-<!--                            <artifactId>nothing</artifactId>-->
-<!--                        </include>-->
-<!--                    </includes>-->
-<!--                </configuration>-->
-<!--                <executions>-->
-<!--                    <execution>-->
-<!--                        <goals>-->
-<!--                            <goal>repackage</goal>-->
-<!--                        </goals>-->
-<!--                    </execution>-->
-<!--                </executions>-->
 <!--            </plugin>-->
 
+            <!-- 创建一个不包含依赖的jar包 -->
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <mainClass>com.backendsys.Application</mainClass>
+                    <layout>ZIP</layout>
+                    <includes>
+                        <include>
+                            <groupId>nothing</groupId>
+                            <artifactId>nothing</artifactId>
+                        </include>
+                    </includes>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
             <!-- 将第三方依赖包拷贝到lib目录 (没有更新时注释) -->
 <!--            <plugin>-->
 <!--                <groupId>org.apache.maven.plugins</groupId>-->