add Dockerfile
This commit is contained in:
8
Dockerfile
Normal file
8
Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
FROM bitnami/java:17-debian-12
|
||||||
|
|
||||||
|
COPY target/*.jar /app/app.jar
|
||||||
|
|
||||||
|
COPY script/entrypoint.sh /opt/scripts/entrypoint.sh
|
||||||
|
RUN chmod 0740 /opt/scripts/entrypoint.sh
|
||||||
|
|
||||||
|
CMD /opt/scripts/entrypoint.sh
|
||||||
1
pom.xml
1
pom.xml
@@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
<artifactId>ec-config-server</artifactId>
|
<artifactId>ec-config-server</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
|
|||||||
14
script/entrypoint.sh
Normal file
14
script/entrypoint.sh
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if test "${SPRING_PROFILES_ACTIVE}" != '';
|
||||||
|
then
|
||||||
|
echo "spring active profile is "$SPRING_PROFILES_ACTIVE
|
||||||
|
JAVA_OPTIONS="$JAVA_OPTIONS -Dspring.profiles.active=cloud,native,$SPRING_PROFILES_ACTIVE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "${LOCAL_DOCKER_ENV}" = 'true';
|
||||||
|
then
|
||||||
|
JAVA_OPTIONS="$JAVA_OPTIONS -Dspring.profiles.active=native"
|
||||||
|
fi
|
||||||
|
|
||||||
|
java $JAVA_OPTIONS -jar /app/app.jar
|
||||||
Reference in New Issue
Block a user