Skip to content

Commit

Permalink
Merge pull request #42 from rishiraj88/develop
Browse files Browse the repository at this point in the history
Add Dockerfile and update release version for Order.
  • Loading branch information
rishiraj88 authored Feb 11, 2025
2 parents a453b3b + e540f3c commit a2ae589
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
Expand All @@ -29,6 +30,7 @@ jobs:
cache: maven
- name: Build with Maven
shell: bash
working-directory: ./order
run: mvn clean install
# run: mvn -B package --file pom.xml

Expand Down
24 changes: 24 additions & 0 deletions inventory/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Build
# /~https://github.com/carlossg/docker-maven/blob/8cfe24baffa5b250f7bb2d31ce233fc28f3c4f20/amazoncorretto-21/Dockerfile
FROM maven:3.9.9-amazoncorretto-21-alpine AS build
WORKDIR /app
COPY ./src .
COPY ./pom.xml .
RUN mvn clean package

# Deploy
FROM amazoncorretto:8-alpine3.21-jre AS deploy
WORKDIR /app
RUN mkdir target

LABEL maintainer="Rishi Raj"
LABEL version="1.0"
LABEL description="Dockerfile for Order-Manager::Inventory with JDK 21 and MySQL"

COPY --from=build /app/target/inventory-1.0.1-SNAPSHOT.jar /app/target/
EXPOSE 8080
#ENTRYPOINT [ "java", "-jar","target/inventory-1.0.1-SNAPSHOT.jar" ]
CMD [ "java", "-jar","target/inventory-1.0.1-SNAPSHOT.jar" ]

VOLUME ./mysql:/var/lib/mysql
VOLUME ./docker/mysql/init.sql:/docker-entrypoint-initdb.d/init.sql
3 changes: 2 additions & 1 deletion inventory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
</parent>
<groupId>om</groupId>
<artifactId>inventory</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.1-SNAPSHOT</version>
<name>inventory</name>
<description>order module for order management APIs, built with Spring Boot</description>
<properties>
<java.version>21</java.version>
<spring-boot.repackage.skip>true</spring-boot.repackage.skip>
</properties>
<dependencies>
<dependency>
Expand Down
24 changes: 24 additions & 0 deletions order/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Build
# /~https://github.com/carlossg/docker-maven/blob/8cfe24baffa5b250f7bb2d31ce233fc28f3c4f20/amazoncorretto-21/Dockerfile
FROM maven:3.9.9-amazoncorretto-21-alpine AS build
WORKDIR /app
COPY ./src .
COPY ./pom.xml .
RUN mvn clean package

# Deploy
FROM amazoncorretto:8-alpine3.21-jre AS deploy
WORKDIR /app
RUN mkdir target

LABEL maintainer="Rishi Raj"
LABEL version="1.0"
LABEL description="Dockerfile for Order-Manager::Order with JDK 21, Confluent Kafka and MySQL"

COPY --from=build /app/target/order-1.0.1-SNAPSHOT.jar /app/target/
EXPOSE 8080
#ENTRYPOINT [ "java", "-jar","target/order-1.0.1-SNAPSHOT.jar" ]
CMD [ "java", "-jar","target/order-1.0.1-SNAPSHOT.jar" ]

VOLUME ./mysql:/var/lib/mysql
VOLUME ./docker/mysql/init.sql:/docker-entrypoint-initdb.d/init.sql
4 changes: 2 additions & 2 deletions order/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
</parent>
<groupId>om</groupId>
<artifactId>order</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.1-SNAPSHOT</version>
<name>order</name>
<description>order module for order management APIs</description>
<properties>
<java.version>21</java.version>
<spring-cloud.version>2023.0.1</spring-cloud.version>
<spring-boot.repackage.skip>true</spring-boot.repackage.skip>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -134,5 +135,4 @@
</plugin>
</plugins>
</build>

</project>
6 changes: 3 additions & 3 deletions product/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ LABEL maintainer="Rishi Raj"
LABEL version="1.0"
LABEL description="Dockerfile for Order-Manager::Product with JDK 21 and MongoDB"

COPY --from=build /app/target/product-0.0.1-SNAPSHOT.jar /app/target/
COPY --from=build /app/target/product-1.0.1-SNAPSHOT.jar /app/target/
EXPOSE 8080
#ENTRYPOINT [ "java", "-jar","target/product-0.0.1-SNAPSHOT.jar" ]
CMD [ "java", "-jar","target/product-0.0.1-SNAPSHOT.jar" ]
#ENTRYPOINT [ "java", "-jar","target/product-1.0.1-SNAPSHOT.jar" ]
CMD [ "java", "-jar","target/product-1.0.1-SNAPSHOT.jar" ]


VOLUME ./data:/data/db
3 changes: 1 addition & 2 deletions product/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>om</groupId>
<artifactId>product</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0.1-SNAPSHOT</version>
<name>product</name>
<description>product module for order management APIs, built with Spring Boot</description>
<properties>
Expand Down Expand Up @@ -70,7 +70,6 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<!--version>1.18.36</version-->
<scope>provided</scope>
</dependency>

Expand Down

0 comments on commit a2ae589

Please sign in to comment.