BAEL-1614 - additions for docker (#4455)

This commit is contained in:
Eric Goebelbecker 2018-06-10 22:00:21 -04:00 committed by maibin
parent 40d3b96820
commit ea37ada296
4 changed files with 37 additions and 1 deletions

View File

@ -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-ops.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"]

View File

@ -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/WebjarsdemoApplication/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>

4
spring-boot-ops/docker/run.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
java -Dspring.profiles.active=$1 -Dlogging.config=/logback.xml -jar /app.war

View File

@ -137,7 +137,8 @@
<goal>repackage</goal>
</goals>
<configuration>
<mainClass>org.baeldung.boot.Application</mainClass>
<mainClass>com.baeldung.webjar.WebjarsdemoApplication</mainClass>
<outputDirectory>${project.basedir}/docker</outputDirectory>
</configuration>
</execution>
</executions>