add Dockerfile

This commit is contained in:
2024-08-30 00:37:02 +10:00
parent edd8415872
commit 53b70abba0
3 changed files with 22 additions and 1 deletions

8
Dockerfile Normal file
View 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

View File

@@ -12,7 +12,6 @@
<artifactId>ec-config-server</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<licenses>
<license>

14
script/entrypoint.sh Normal file
View 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