BAEL-1614 - Docker with Java Guest Post (#4474)
* BAEL-1614 - additions for docker * BAEL-1614 - move docker project to guest module
This commit is contained in:
parent
b59da11c66
commit
272f018f90
|
@ -1,3 +1,2 @@
|
||||||
Manifest-Version: 1.0
|
Manifest-Version: 1.0
|
||||||
Class-Path:
|
Class-Path:
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
# Alpine Linux with OpenJDK JRE
|
||||||
|
FROM openjdk:8-jre-alpine
|
||||||
|
RUN apk add --no-cache bash
|
||||||
|
|
||||||
|
# copy fat WAR
|
||||||
|
COPY spring-boot-app-0.0.1-SNAPSHOT.war /app.war
|
||||||
|
|
||||||
|
# copy fat WAR
|
||||||
|
COPY logback.xml /logback.xml
|
||||||
|
|
||||||
|
COPY run.sh /run.sh
|
||||||
|
|
||||||
|
# runs application
|
||||||
|
#CMD ["/usr/bin/java", "-jar", "-Dspring.profiles.active=default", "-Dlogging.config=/logback.xml", "/app.war"]
|
||||||
|
|
||||||
|
ENTRYPOINT ["/run.sh"]
|
|
@ -0,0 +1,15 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration>
|
||||||
|
<include resource="org/springframework/boot/logging/logback/base.xml"/>
|
||||||
|
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
|
||||||
|
<file>/var/log/Application/application.log</file>
|
||||||
|
<append>true</append>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%-7d{yyyy-MM-dd HH:mm:ss:SSS} %m%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="FILE" />
|
||||||
|
</root>
|
||||||
|
</configuration>
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
java -Dspring.profiles.active=$1 -Dlogging.config=/logback.xml -jar /app.war
|
||||||
|
|
|
@ -51,6 +51,22 @@
|
||||||
<warSourceDirectory>WebContent</warSourceDirectory>
|
<warSourceDirectory>WebContent</warSourceDirectory>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<mainClass>com.stackify.Application</mainClass>
|
||||||
|
<outputDirectory>${project.basedir}/docker</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,6 @@
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<mainClass>com.baeldung.webjar.WebjarsdemoApplication</mainClass>
|
<mainClass>com.baeldung.webjar.WebjarsdemoApplication</mainClass>
|
||||||
<outputDirectory>${project.basedir}/docker</outputDirectory>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
|
Loading…
Reference in New Issue