adding profiles to dockerfile

This commit is contained in:
Szakalakamaka
2020-10-28 12:16:36 +01:00
parent 4e7d9ffd33
commit be285ef343
4 changed files with 48 additions and 29 deletions

54
.idea/workspace.xml generated
View File

@@ -23,7 +23,7 @@
</component>
<component name="ChangeListManager">
<list default="true" id="458cde88-df3d-44bc-9d57-a33823e2f1a6" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/src/main/resources/application.properties" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application.properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -75,7 +75,7 @@
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit5" />
<property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrarySuperClass.JUnit5" value="" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/src/main/resources" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="restartRequiresConfirmation" value="false" />
<property name="settings.editor.selected.configurable" value="MavenSettings" />
</component>
@@ -263,20 +263,6 @@
<option name="presentableId" value="Default" />
<updated>1598862102028</updated>
</task>
<task id="LOCAL-00056" summary="adding logs from the application">
<created>1601295490642</created>
<option name="number" value="00056" />
<option name="presentableId" value="LOCAL-00056" />
<option name="project" value="LOCAL" />
<updated>1601295490642</updated>
</task>
<task id="LOCAL-00057" summary="adding logs from the application">
<created>1601297400597</created>
<option name="number" value="00057" />
<option name="presentableId" value="LOCAL-00057" />
<option name="project" value="LOCAL" />
<updated>1601297400597</updated>
</task>
<task id="LOCAL-00058" summary="adding logs from the application">
<created>1601297733933</created>
<option name="number" value="00058" />
@@ -606,7 +592,21 @@
<option name="project" value="LOCAL" />
<updated>1603723957962</updated>
</task>
<option name="localTasksCounter" value="105" />
<task id="LOCAL-00105" summary="testing config service">
<created>1603724204298</created>
<option name="number" value="00105" />
<option name="presentableId" value="LOCAL-00105" />
<option name="project" value="LOCAL" />
<updated>1603724204298</updated>
</task>
<task id="LOCAL-00106" summary="testing config service">
<created>1603724236562</created>
<option name="number" value="00106" />
<option name="presentableId" value="LOCAL-00106" />
<option name="project" value="LOCAL" />
<updated>1603724236562</updated>
</task>
<option name="localTasksCounter" value="107" />
<servers />
</component>
<component name="UnknownFeatures">
@@ -702,37 +702,37 @@
<state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1602062761111" />
<state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1602662342585" />
<state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1602147205037" />
<state width="1877" height="309" key="GridCell.Tab.0.bottom" timestamp="1602674787447">
<state width="1877" height="317" key="GridCell.Tab.0.bottom" timestamp="1603724251155">
<screen x="1920" y="0" width="1920" height="1160" />
</state>
<state width="1877" height="239" key="GridCell.Tab.0.bottom/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275797041" />
<state width="1493" height="217" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1602249237084" />
<state width="1877" height="261" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1602255424969" />
<state width="1877" height="309" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1602674787447" />
<state width="1877" height="317" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1603724251155" />
<state width="1493" height="217" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1602147432366" />
<state width="1877" height="309" key="GridCell.Tab.0.center" timestamp="1602674787447">
<state width="1877" height="317" key="GridCell.Tab.0.center" timestamp="1603724251155">
<screen x="1920" y="0" width="1920" height="1160" />
</state>
<state width="1877" height="239" key="GridCell.Tab.0.center/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275797041" />
<state width="1493" height="217" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1602249237084" />
<state width="1877" height="261" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1602255424968" />
<state width="1877" height="309" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1602674787447" />
<state width="1877" height="317" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1603724251155" />
<state width="1493" height="217" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1602147432366" />
<state width="1877" height="309" key="GridCell.Tab.0.left" timestamp="1602674787447">
<state width="1877" height="317" key="GridCell.Tab.0.left" timestamp="1603724251155">
<screen x="1920" y="0" width="1920" height="1160" />
</state>
<state width="1877" height="239" key="GridCell.Tab.0.left/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275797041" />
<state width="1493" height="217" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1602249237084" />
<state width="1877" height="261" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1602255424967" />
<state width="1877" height="309" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1602674787447" />
<state width="1877" height="317" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1603724251155" />
<state width="1493" height="217" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1602147432366" />
<state width="1877" height="309" key="GridCell.Tab.0.right" timestamp="1602674787447">
<state width="1877" height="317" key="GridCell.Tab.0.right" timestamp="1603724251155">
<screen x="1920" y="0" width="1920" height="1160" />
</state>
<state width="1877" height="239" key="GridCell.Tab.0.right/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275797041" />
<state width="1493" height="217" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1602249237084" />
<state width="1877" height="261" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1602255424969" />
<state width="1877" height="309" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1602674787447" />
<state width="1877" height="317" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1603724251155" />
<state width="1493" height="217" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1602147432366" />
<state width="1877" height="297" key="GridCell.Tab.1.bottom" timestamp="1602672852817">
<screen x="1920" y="0" width="1920" height="1160" />
@@ -780,13 +780,13 @@
</state>
<state x="277" y="57" key="SettingsEditor/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1600935670743" />
<state x="277" y="57" key="SettingsEditor/0.0.1536.824@0.0.1536.824" timestamp="1601975962923" />
<state x="2371" y="204" key="Vcs.Push.Dialog.v2" timestamp="1603723968132">
<state x="2371" y="204" key="Vcs.Push.Dialog.v2" timestamp="1603724239080">
<screen x="1920" y="0" width="1920" height="1160" />
</state>
<state x="451" y="183" key="Vcs.Push.Dialog.v2/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275760386" />
<state x="361" y="145" key="Vcs.Push.Dialog.v2/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1600350277680" />
<state x="2371" y="183" key="Vcs.Push.Dialog.v2/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1602255416393" />
<state x="2371" y="204" key="Vcs.Push.Dialog.v2/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1603723968132" />
<state x="2371" y="204" key="Vcs.Push.Dialog.v2/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1603724239080" />
<state x="361" y="145" key="Vcs.Push.Dialog.v2/0.0.1536.824@0.0.1536.824" timestamp="1602145235569" />
<state width="968" height="528" key="XDebugger.FullValuePopup" timestamp="1602076898344">
<screen x="1920" y="0" width="1920" height="1040" />

View File

@@ -16,4 +16,4 @@ COPY --from=layerBuilder application/spring-boot-loader/ ./
COPY --from=layerBuilder application/snapshot-dependencies/ ./
COPY --from=layerBuilder application/application/ ./
ENTRYPOINT ["java", "-Djava.security.cgd=file:/dev/./urandom", "org.springframework.boot.loader.JarLauncher"]
ENTRYPOINT ["java", "-Djava.security.cgd=file:/dev/./urandom", "-Dspring.profiles.active=DEV", "org.springframework.boot.loader.JarLauncher"]

19
Dockerfile-PROD Normal file
View File

@@ -0,0 +1,19 @@
FROM maven:3.6.3-jdk-14 as builder
WORKDIR application
COPY ./ ./
RUN mvn clean install
FROM openjdk:14 as layerBuilder
WORKDIR application
ARG JAR_FILE=application/target/*.jar
COPY --from=builder ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract
FROM openjdk:14
WORKDIR application
COPY --from=layerBuilder application/dependencies/ ./
COPY --from=layerBuilder application/spring-boot-loader/ ./
COPY --from=layerBuilder application/snapshot-dependencies/ ./
COPY --from=layerBuilder application/application/ ./
ENTRYPOINT ["java", "-Djava.security.cgd=file:/dev/./urandom", "-Dspring.profiles.active=PROD", "org.springframework.boot.loader.JarLauncher"]

View File

@@ -6,7 +6,7 @@ services:
klaus:
build:
context: .
dockerfile: Dockerfile
dockerfile: Dockerfile-PROD
container_name: klaus
restart: "no"
ports: