summaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorQuoc Nghia Nguyen <quocnghia.nguyen@orange.com>2018-04-13 13:56:42 +0200
committerQuoc Nghia Nguyen <quocnghia.nguyen@orange.com>2018-04-13 14:25:44 +0200
commit6b8c1f5d9844c92774243834aa3f0f7136a1e222 (patch)
tree3e0efed348f2165c6ded3427fff7a11e3977c310 /Dockerfile
parent65352f84525c13c7469ba435b3a0adbc83ae4cfc (diff)
Externalized app params for deployment
- .env: contains environment variables which override application's default properties - Dockerfile & docker-compose.yml: takes environment variables into account - application.properties: included external services configurations Change-Id: I49937e66d514a42a174cff3bf6c383ecfc8e28e0 Issue-ID: EXTAPI-49 Signed-off-by: Quoc Nghia Nguyen <quocnghia.nguyen@orange.com>
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Dockerfile b/Dockerfile
index a3c56b2..09b2019 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,11 @@
-FROM openjdk:8-jdk-alpine
+FROM openjdk:8-jre-alpine
+ARG SERVER_PORT
ARG PKG_FILENAME=nbi-rest-services-1.0.0-SNAPSHOT.jar
-
ADD target/$PKG_FILENAME app.jar
-ENV JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=docker -jar"
-ENTRYPOINT exec java $JAVA_OPTS /app.jar \ No newline at end of file
+
+ENV SERVER_PORT=${SERVER_PORT:-8080}
+ENV JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -jar"
+
+EXPOSE $SERVER_PORT
+ENTRYPOINT java $JAVA_OPTS -jar /app.jar