Skip to content

Commit

Permalink
Dockerfile Nistagram Admin Microservice (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
DusanStevic authored Sep 15, 2021
1 parent 87377e4 commit 7d5f66f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# The final image build process will use this build image as a base image
# that will already have all the dependencies inside it. Even if there is a new dependency
# added in pom.xml the final image will only download that delta dependency as the rest of the
# dependencies would already be present via base builder image.
FROM stevicdule/mvn-base-nistagram-admin:1.0.0-dev AS appBuild
ARG STAGE=dev
LABEL maintainer="stevicdule@gmail.com"

WORKDIR /usr/src/admin_service
COPY . .
RUN mvn package -P${STAGE} -DskipTests

FROM openjdk:8-jdk-alpine AS appRuntime
WORKDIR /app
COPY --from=appBuild /usr/src/admin_service/target/admin_service.jar ./
EXPOSE 8080
CMD java -jar admin_service.jar
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<appName>admin_service</appName>
<spring-cloud.version>2020.0.3</spring-cloud.version>
</properties>
<dependencies>
Expand Down Expand Up @@ -88,6 +89,7 @@
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<finalName>${appName}</finalName>
</build>

</project>

0 comments on commit 7d5f66f

Please sign in to comment.