Skip to content

Commit

Permalink
docs in dockerfile, add spring profile selection
Browse files Browse the repository at this point in the history
  • Loading branch information
EugenMayer committed Sep 25, 2018
1 parent 9108555 commit bb21e75
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RUN apt-get update \
&& mkdir /dist /src
COPY . /src
WORKDIR /src
# HINT: yet here is no difference in the build of dev / prod. We just use different startup commands later in the docker images
# development build..with swagger and so on
RUN SPRING_PROFILES_ACTIVE=dev gradle clean build \
&& cp build/libs/*SNAPSHOT.war /dist/development.war
Expand All @@ -27,7 +28,7 @@ ENV LOG_BASE_DIR=/var/log
COPY --from=builder /dist/development.war ${JAR_FILE_BASEDIR}/${JAR_FILE_NAME}
EXPOSE 8080
EXPOSE 5001
CMD ["java","-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5001", "-jar","/opt/app/app.war"]
CMD ["java","-Dspring.profiles.active=dev","-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5001", "-jar","/opt/app/app.war"]

# just a trick to ensure that he default docker image resulting is production
FROM production

0 comments on commit bb21e75

Please sign in to comment.