Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…em-2 into master
  • Loading branch information
colinbut committed Sep 10, 2024
2 parents 704e1a2 + a09132b commit b4ad305
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 11 deletions.
2 changes: 1 addition & 1 deletion customer-service/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*
target/*
!target/customer-service-*.jar
8 changes: 7 additions & 1 deletion customer-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
FROM maven:3.9.3-eclipse-temurin-8-alpine as build
WORKDIR /app
COPY . .
RUN mvn package

FROM openjdk:8-alpine
COPY target/customer-service-*.jar /usr/local/bin/customer-service.jar
COPY --from=build /app/target/customer-service-*.jar /usr/local/bin/customer-service.jar
RUN chmod +x /usr/local/bin/customer-service.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/usr/local/bin/customer-service.jar"]
2 changes: 1 addition & 1 deletion order-service/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*
build/*
!build/libs/order-service-*.jar
7 changes: 6 additions & 1 deletion order-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
FROM gradle:6.2.2-jdk8 as build
WORKDIR /app
COPY . .
RUN gradle build --no-daemon -x test

FROM openjdk:8-alpine
COPY build/libs/order-service-*.jar /usr/local/bin/order-service.jar
COPY --from=build /app/build/libs/order-service-*.jar /usr/local/bin/order-service.jar
RUN chmod +x /usr/local/bin/order-service.jar
ENTRYPOINT ["java", "-jar", "/usr/local/bin/order-service.jar"]
2 changes: 1 addition & 1 deletion product-service/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*
target/*
!target/product-service-*.jar
7 changes: 6 additions & 1 deletion product-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
FROM maven:3.9.3-eclipse-temurin-8-alpine as build
WORKDIR /app
COPY . .
RUN mvn package

FROM openjdk:8-alpine
COPY target/product-service-*.jar /usr/local/bin/product-service.jar
COPY --from=build /app/target/product-service-*.jar /usr/local/bin/product-service.jar
RUN chmod +x /usr/local/bin/product-service.jar
ENTRYPOINT ["java", "-jar", "/usr/local/bin/product-service.jar"]
2 changes: 0 additions & 2 deletions sales-order-system/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
node_modules
public
package*
README.md
.gitignore
8 changes: 7 additions & 1 deletion sales-order-system/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
FROM node:16-alpine AS build
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build

FROM httpd:2.4
COPY ./build /usr/local/apache2/htdocs/
COPY --from=build /app/build /usr/local/apache2/htdocs/
2 changes: 1 addition & 1 deletion user-service/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*
target/*
!target/user-service-*.jar
7 changes: 6 additions & 1 deletion user-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
FROM maven:3.9.3-eclipse-temurin-8-alpine as build
WORKDIR /app
COPY . .
RUN mvn package

FROM openjdk:8-alpine
COPY target/user-service-*.jar /usr/local/bin/user-service.jar
COPY --from=build /app/target/user-service-*.jar /usr/local/bin/user-service.jar
RUN chmod +x /usr/local/bin/user-service.jar
ENTRYPOINT ["java", "-jar", "/usr/local/bin/user-service.jar"]

0 comments on commit b4ad305

Please sign in to comment.