-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
496 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
version: '2.1' | ||
|
||
services: | ||
product: | ||
build: product-service | ||
mem_limit: 350m | ||
environment: | ||
- SPRING_PROFILES_ACTIVE=docker | ||
|
||
recommendation: | ||
build: recommendation-service | ||
mem_limit: 350m | ||
environment: | ||
- SPRING_PROFILES_ACTIVE=docker | ||
|
||
review: | ||
build: review-service | ||
mem_limit: 350m | ||
environment: | ||
- SPRING_PROFILES_ACTIVE=docker | ||
|
||
product-composite: | ||
build: product-composite-service | ||
mem_limit: 350m | ||
ports: | ||
- "8080:8080" | ||
environment: | ||
- SPRING_PROFILES_ACTIVE=docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#### Start of builder image | ||
# ------------------------ | ||
# Builder stage to prepare application for final image | ||
FROM openjdk:14-slim-buster as builder | ||
WORKDIR temp | ||
|
||
# Could be set to different jar file location | ||
ARG JAR_FILE=target/*.jar | ||
|
||
# Copy fat jar file to current image builder | ||
COPY ${JAR_FILE} application.jar | ||
|
||
# Extract the jar file layers | ||
RUN java -Djarmode=layertools -jar --enable-preview application.jar extract | ||
#### End of builder stage | ||
|
||
#### Start of actual image | ||
# ------------------------ | ||
# Build image based on JDK 14 base image, based on latest debian buster OS | ||
FROM openjdk:14-slim-buster | ||
|
||
# Set image information, but could be set to different location from command line | ||
ARG IMAGE_VERSION="0.0.1-SNAPSHOT" | ||
ARG IMAGE_NAME="Product Composite Service" | ||
ARG MAINTAINER="Mohamed Taman <[email protected]>" | ||
|
||
LABEL version=${IMAGE_VERSION} name=${IMAGE_NAME} maintainer=${MAINTAINER} | ||
|
||
# Limiting security access to not user root user | ||
RUN addgroup siriusxi && useradd -g siriusxi -ms /bin/bash taman | ||
|
||
# Setting user to current created user | ||
USER taman | ||
|
||
# Set working directory to application folder | ||
WORKDIR /home/taman/application | ||
|
||
# Copy all layers from builder stage to current image | ||
COPY --from=builder temp/dependencies/ ./ | ||
COPY --from=builder temp/snapshot-dependencies/ ./ | ||
COPY --from=builder temp/resources/ ./ | ||
COPY --from=builder temp/application/ ./ | ||
|
||
# Expose current application to port 8080 | ||
EXPOSE 8080 | ||
|
||
ARG JAVA_OPTS="" | ||
|
||
# Run the application with JVM configs if any | ||
ENTRYPOINT ["bash", "-c", \ | ||
"java -server --enable-preview -XX:+UseContainerSupport \ | ||
-XX:+AlwaysActAsServerClassMachine -XX:+UseG1GC -XX:+UseStringDeduplication ${JAVA_OPTS} \ | ||
org.springframework.boot.loader.JarLauncher ${0} ${@}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...mposite-service/src/main/resources/META-INF/additional-spring-configuration-metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"properties": [ | ||
{ | ||
"name": "app.product-service.host", | ||
"type": "java.lang.String", | ||
"description": "Description for app.product-service.host." | ||
}, | ||
{ | ||
"name": "app.product-service.port", | ||
"type": "java.lang.Integer", | ||
"description": "Description for app.product-service.port." | ||
}, | ||
{ | ||
"name": "app.recommendation-service.host", | ||
"type": "java.lang.String", | ||
"description": "Description for app.recommendation-service.host." | ||
}, | ||
{ | ||
"name": "app.recommendation-service.port", | ||
"type": "java.lang.Integer", | ||
"description": "Description for app.recommendation-service.port." | ||
}, | ||
{ | ||
"name": "app.review-service.host", | ||
"type": "java.lang.String", | ||
"description": "Description for app.review-service.host." | ||
}, | ||
{ | ||
"name": "app.review-service.port", | ||
"type": "java.lang.Integer", | ||
"description": "Description for app.review-service.port." | ||
} | ||
] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#### Start of builder image | ||
# ------------------------ | ||
# Builder stage to prepare application for final image | ||
FROM openjdk:14-slim-buster as builder | ||
WORKDIR temp | ||
|
||
# Fatjar location, but could be set to different location from command line | ||
ARG JAR_FILE=target/*.jar | ||
|
||
# Copy fat jar file to current image builder | ||
COPY ${JAR_FILE} application.jar | ||
|
||
# Extract the jar file layers | ||
RUN java -Djarmode=layertools -jar --enable-preview application.jar extract | ||
#### End of builder stage | ||
|
||
#### Start of actual image | ||
# ------------------------ | ||
# Build image based on JDK 14 base image, based on latest debian buster OS | ||
FROM openjdk:14-slim-buster | ||
MAINTAINER Mohamed Taman <[email protected]> | ||
|
||
# Set image information, but could be set to different location from command line | ||
ARG IMAGE_VERSION="0.0.1-SNAPSHOT" | ||
ARG IMAGE_NAME="Product Service" | ||
ARG MAINTAINER="Mohamed Taman <[email protected]>" | ||
|
||
LABEL version=${IMAGE_VERSION} name=${IMAGE_NAME} maintainer=${MAINTAINER} | ||
|
||
# Limiting security access to not user root user | ||
RUN addgroup siriusxi && useradd -g siriusxi -ms /bin/bash taman | ||
|
||
# Setting user to current created user | ||
USER taman | ||
|
||
# Set working directory to application folder | ||
WORKDIR /home/taman/application | ||
|
||
# Copy all layers from builder stage to current image | ||
COPY --from=builder temp/dependencies/ ./ | ||
COPY --from=builder temp/snapshot-dependencies/ ./ | ||
COPY --from=builder temp/resources/ ./ | ||
COPY --from=builder temp/application/ ./ | ||
|
||
# Expose current application to port 8080 | ||
EXPOSE 8080 | ||
|
||
ARG JAVA_OPTS="" | ||
|
||
# Run the application with JVM configs if any | ||
ENTRYPOINT ["bash", "-c", \ | ||
"java -server --enable-preview -XX:+UseContainerSupport \ | ||
-XX:+AlwaysActAsServerClassMachine -XX:+UseG1GC -XX:+UseStringDeduplication ${JAVA_OPTS} \ | ||
org.springframework.boot.loader.JarLauncher ${0} ${@}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#### Start of builder image | ||
# ------------------------ | ||
# Builder stage to prepare application for final image | ||
FROM openjdk:14-slim-buster as builder | ||
WORKDIR temp | ||
|
||
# Could be set to different jar file location | ||
ARG JAR_FILE=target/*.jar | ||
|
||
# Copy fat jar file to current image builder | ||
COPY ${JAR_FILE} application.jar | ||
|
||
# Extract the jar file layers | ||
RUN java -Djarmode=layertools -jar --enable-preview application.jar extract | ||
#### End of builder stage | ||
|
||
#### Start of actual image | ||
# ------------------------ | ||
# Build image based on JDK 14 base image, based on latest debian buster OS | ||
FROM openjdk:14-slim-buster | ||
MAINTAINER Mohamed Taman <[email protected]> | ||
|
||
# Set image information, but could be set to different location from command line | ||
ARG IMAGE_VERSION="0.0.1-SNAPSHOT" | ||
ARG IMAGE_NAME="Recommendation Service" | ||
ARG MAINTAINER="Mohamed Taman <[email protected]>" | ||
|
||
LABEL version=${IMAGE_VERSION} name=${IMAGE_NAME} maintainer=${MAINTAINER} | ||
|
||
# Limiting security access to not user root user | ||
RUN addgroup siriusxi && useradd -g siriusxi -ms /bin/bash taman | ||
|
||
# Setting user to current created user | ||
USER taman | ||
|
||
# Set working directory to application folder | ||
WORKDIR /home/taman/application | ||
|
||
# Copy all layers from builder stage to current image | ||
COPY --from=builder temp/dependencies/ ./ | ||
COPY --from=builder temp/snapshot-dependencies/ ./ | ||
COPY --from=builder temp/resources/ ./ | ||
COPY --from=builder temp/application/ ./ | ||
|
||
# Expose current application to port 8080 | ||
EXPOSE 8080 | ||
|
||
ARG JAVA_OPTS="" | ||
|
||
# Run the application with JVM configs if any | ||
ENTRYPOINT ["bash", "-c", \ | ||
"java -server --enable-preview -XX:+UseContainerSupport \ | ||
-XX:+AlwaysActAsServerClassMachine -XX:+UseG1GC -XX:+UseStringDeduplication ${JAVA_OPTS} \ | ||
org.springframework.boot.loader.JarLauncher ${0} ${@}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#### Start of builder image | ||
# ------------------------ | ||
# Builder stage to prepare application for final image | ||
FROM openjdk:14-slim-buster as builder | ||
WORKDIR temp | ||
|
||
# Could be set to different jar file location | ||
ARG JAR_FILE=target/*.jar | ||
|
||
# Copy fat jar file to current image builder | ||
COPY ${JAR_FILE} application.jar | ||
|
||
# Extract the jar file layers | ||
RUN java -Djarmode=layertools -jar --enable-preview application.jar extract | ||
#### End of builder stage | ||
|
||
#### Start of actual image | ||
# ------------------------ | ||
# Build image based on JDK 14 base image, based on latest debian buster OS | ||
FROM openjdk:14-slim-buster | ||
MAINTAINER Mohamed Taman <[email protected]> | ||
|
||
# Set image information, but could be set to different location from command line | ||
ARG IMAGE_VERSION="0.0.1-SNAPSHOT" | ||
ARG IMAGE_NAME="Review Service" | ||
ARG MAINTAINER="Mohamed Taman <[email protected]>" | ||
|
||
LABEL version=${IMAGE_VERSION} name=${IMAGE_NAME} maintainer=${MAINTAINER} | ||
|
||
# Limiting security access to not user root user | ||
RUN addgroup siriusxi && useradd -g siriusxi -ms /bin/bash taman | ||
|
||
# Setting user to current created user | ||
USER taman | ||
|
||
# Set working directory to application folder | ||
WORKDIR /home/taman/application | ||
|
||
# Copy all layers from builder stage to current image | ||
COPY --from=builder temp/dependencies/ ./ | ||
COPY --from=builder temp/snapshot-dependencies/ ./ | ||
COPY --from=builder temp/resources/ ./ | ||
COPY --from=builder temp/application/ ./ | ||
|
||
# Expose current application to port 8080 | ||
EXPOSE 8080 | ||
|
||
ARG JAVA_OPTS="" | ||
|
||
# Run the application with JVM configs if any | ||
ENTRYPOINT ["bash", "-c", \ | ||
"java -server --enable-preview -XX:+UseContainerSupport \ | ||
-XX:+AlwaysActAsServerClassMachine -XX:+UseG1GC -XX:+UseStringDeduplication ${JAVA_OPTS} \ | ||
org.springframework.boot.loader.JarLauncher ${0} ${@}"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.