diff --git a/ci/build-service-image.sh b/ci/build-service-image.sh new file mode 100755 index 0000000..d194a5c --- /dev/null +++ b/ci/build-service-image.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)" +SERVICE_NAME="${1:-}" +IMAGE_REF="${2:-}" +SERVICE_VERSION="${SERVICE_VERSION:-${3:-dev}}" +MAVEN_REPO_LOCAL="${MAVEN_REPO_LOCAL:-${HOME}/.m2/repository}" +DOCKER_PLATFORM="${DOCKER_PLATFORM:-linux/amd64}" +SKIP_MAVEN_BUILD="${SKIP_MAVEN_BUILD:-0}" + +if [ -z "${SERVICE_NAME}" ] || [ -z "${IMAGE_REF}" ]; then + echo "usage: ci/build-service-image.sh [service-version]" >&2 + exit 1 +fi + +case "${SERVICE_NAME}" in + auth) + MODULE_PATH="rc-auth" + DOCKER_CONTEXT="rc-auth" + ;; + gateway) + MODULE_PATH="rc-gateway" + DOCKER_CONTEXT="rc-gateway" + ;; + external) + MODULE_PATH="rc-service/rc-service-external/external-start" + DOCKER_CONTEXT="rc-service/rc-service-external" + ;; + console) + MODULE_PATH="rc-service/rc-service-console/console-start" + DOCKER_CONTEXT="rc-service/rc-service-console" + ;; + other) + MODULE_PATH="rc-service/rc-service-other/other-start" + DOCKER_CONTEXT="rc-service/rc-service-other" + ;; + live) + MODULE_PATH="rc-service/rc-service-live/live-start" + DOCKER_CONTEXT="rc-service/rc-service-live" + ;; + wallet) + MODULE_PATH="rc-service/rc-service-wallet/wallet-start" + DOCKER_CONTEXT="rc-service/rc-service-wallet" + ;; + order) + MODULE_PATH="rc-service/rc-service-order/order-start" + DOCKER_CONTEXT="rc-service/rc-service-order" + ;; + *) + echo "unsupported service: ${SERVICE_NAME}" >&2 + exit 1 + ;; +esac + +cd "${ROOT_DIR}" + +if [ "${SKIP_MAVEN_BUILD}" != "1" ]; then + "${ROOT_DIR}/ci/install-private-maven.sh" + + mvn -Dmaven.repo.local="${MAVEN_REPO_LOCAL}" \ + -pl "${MODULE_PATH}" \ + -am \ + -Dmaven.test.skip=true \ + clean package +fi + +docker build \ + --platform "${DOCKER_PLATFORM}" \ + -f "${DOCKER_CONTEXT}/Dockerfile" \ + --build-arg "SERVICE_VERSION=${SERVICE_VERSION}" \ + -t "${IMAGE_REF}" \ + "${DOCKER_CONTEXT}" diff --git a/ci/install-private-maven.sh b/ci/install-private-maven.sh new file mode 100755 index 0000000..fb68007 --- /dev/null +++ b/ci/install-private-maven.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)" +MAVEN_REPO_LOCAL="${MAVEN_REPO_LOCAL:-${HOME}/.m2/repository}" +PRIVATE_ROOT="${ROOT_DIR}/maven_private" + +if [ ! -d "${PRIVATE_ROOT}" ]; then + echo "missing private maven directory: ${PRIVATE_ROOT}" >&2 + exit 1 +fi + +find "${PRIVATE_ROOT}" -mindepth 2 -maxdepth 2 -type d | sort | while read -r version_dir; do + pom_file="$(find "${version_dir}" -maxdepth 1 -type f -name '*.pom' | sort | head -1)" + if [ -z "${pom_file}" ]; then + continue + fi + + jar_file="$(find "${version_dir}" -maxdepth 1 -type f -name '*.jar' ! -name 'original-*' | sort | head -1 || true)" + if [ -n "${jar_file}" ]; then + mvn -Dmaven.repo.local="${MAVEN_REPO_LOCAL}" \ + install:install-file \ + -DpomFile="${pom_file}" \ + -Dfile="${jar_file}" \ + -DgeneratePom=false + else + mvn -Dmaven.repo.local="${MAVEN_REPO_LOCAL}" \ + install:install-file \ + -DpomFile="${pom_file}" \ + -Dfile="${pom_file}" \ + -Dpackaging=pom \ + -DgeneratePom=false + fi +done diff --git a/rc-auth/Dockerfile b/rc-auth/Dockerfile index 0fe05b9..391f5f7 100644 --- a/rc-auth/Dockerfile +++ b/rc-auth/Dockerfile @@ -1,34 +1,36 @@ -#FROM openjdk:17 -FROM 989328288674.dkr.ecr.ap-southeast-1.amazonaws.com/likei-dev:amazoncorretto-17 - -ARG SERVICE_VERSION="v1" -ENV RC_SERVICE_NAME "rc-auth" -ENV RC_SERVICE_VERSION $SERVICE_VERSION - -ENV JVM_OPTION "-XX:InitialRAMPercentage=65.0 -XX:MaxRAMPercentage=65.0" -ENV SERVER_PORT="9000" -ENV SERVER_PROFILE_ACTIVE "prod" - -RUN mkdir -p /application -WORKDIR application -COPY target/rc-auth-*.jar service.jar - -ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ - -Dnacos.remote.client.grpc.timeout=6000 \ - -Dnacos.remote.client.grpc.server.check.timeout=6000 \ - -Dnacos.remote.client.grpc.health.timeout=6000 \ - --add-opens java.base/java.lang.invoke=ALL-UNNAMED \ - --add-opens java.base/java.io=ALL-UNNAMED \ - --add-opens java.base/java.math=ALL-UNNAMED \ - --add-opens java.base/java.net=ALL-UNNAMED \ - --add-opens java.base/java.nio=ALL-UNNAMED \ - --add-opens java.base/java.security=ALL-UNNAMED \ - --add-opens java.base/java.text=ALL-UNNAMED \ - --add-opens java.base/java.time=ALL-UNNAMED \ - --add-opens java.base/java.util=ALL-UNNAMED \ - --add-opens java.base/jdk.internal.access=ALL-UNNAMED \ - --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \ - $JVM_OPTION \ - -jar /application/service.jar \ - --server.port=$SERVER_PORT \ - --spring.profiles.active=$SERVER_PROFILE_ACTIVE +FROM eclipse-temurin:17-jre-jammy + +ARG SERVICE_VERSION="dev" +ENV RC_SERVICE_NAME="rc-auth" +ENV RC_SERVICE_VERSION="${SERVICE_VERSION}" + +ENV JVM_OPTION="-XX:InitialRAMPercentage=65.0 -XX:MaxRAMPercentage=65.0" +ENV SERVER_PORT="9000" +ENV SERVER_PROFILE_ACTIVE="prod" + +RUN apt-get update \ + && apt-get install -y --no-install-recommends wget ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /application +COPY target/rc-auth-*.jar /application/service.jar + +ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ + -Dnacos.remote.client.grpc.timeout=6000 \ + -Dnacos.remote.client.grpc.server.check.timeout=6000 \ + -Dnacos.remote.client.grpc.health.timeout=6000 \ + --add-opens java.base/java.lang.invoke=ALL-UNNAMED \ + --add-opens java.base/java.io=ALL-UNNAMED \ + --add-opens java.base/java.math=ALL-UNNAMED \ + --add-opens java.base/java.net=ALL-UNNAMED \ + --add-opens java.base/java.nio=ALL-UNNAMED \ + --add-opens java.base/java.security=ALL-UNNAMED \ + --add-opens java.base/java.text=ALL-UNNAMED \ + --add-opens java.base/java.time=ALL-UNNAMED \ + --add-opens java.base/java.util=ALL-UNNAMED \ + --add-opens java.base/jdk.internal.access=ALL-UNNAMED \ + --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \ + $JVM_OPTION \ + -jar /application/service.jar \ + --server.port=$SERVER_PORT \ + --spring.profiles.active=$SERVER_PROFILE_ACTIVE diff --git a/rc-gateway/Dockerfile b/rc-gateway/Dockerfile index 1d414f0..1e593ff 100644 --- a/rc-gateway/Dockerfile +++ b/rc-gateway/Dockerfile @@ -1,36 +1,36 @@ -#FROM openjdk:17 -FROM 989328288674.dkr.ecr.ap-southeast-1.amazonaws.com/likei-dev:amazoncorretto-17 - - -ARG SERVICE_VERSION="v1" -ENV RC_SERVICE_NAME "rc-gateway" -ENV RC_SERVICE_VERSION $SERVICE_VERSION - -ENV JVM_OPTION "-XX:InitialRAMPercentage=65.0 -XX:MaxRAMPercentage=65.0" -ENV SERVER_PORT="9000" -ENV SERVER_PROFILE_ACTIVE "prod" - - -RUN mkdir -p /application -WORKDIR application -COPY target/rc-gateway-*.jar service.jar - -ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ - -Dnacos.remote.client.grpc.timeout=6000 \ - -Dnacos.remote.client.grpc.server.check.timeout=6000 \ - -Dnacos.remote.client.grpc.health.timeout=6000 \ - --add-opens java.base/java.lang.invoke=ALL-UNNAMED \ - --add-opens java.base/java.io=ALL-UNNAMED \ - --add-opens java.base/java.math=ALL-UNNAMED \ - --add-opens java.base/java.net=ALL-UNNAMED \ - --add-opens java.base/java.nio=ALL-UNNAMED \ - --add-opens java.base/java.security=ALL-UNNAMED \ - --add-opens java.base/java.text=ALL-UNNAMED \ - --add-opens java.base/java.time=ALL-UNNAMED \ - --add-opens java.base/java.util=ALL-UNNAMED \ - --add-opens java.base/jdk.internal.access=ALL-UNNAMED \ - --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \ - $JVM_OPTION \ - -jar /application/service.jar \ - --server.port=$SERVER_PORT \ - --spring.profiles.active=$SERVER_PROFILE_ACTIVE +FROM eclipse-temurin:17-jre-jammy + +ARG SERVICE_VERSION="dev" +ENV RC_SERVICE_NAME="rc-gateway" +ENV RC_SERVICE_VERSION="${SERVICE_VERSION}" + +ENV JVM_OPTION="-XX:InitialRAMPercentage=65.0 -XX:MaxRAMPercentage=65.0" +ENV SERVER_PORT="9000" +ENV SERVER_PROFILE_ACTIVE="prod" + +RUN apt-get update \ + && apt-get install -y --no-install-recommends wget ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /application +COPY target/rc-gateway-*.jar /application/service.jar + +ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ + -Dnacos.remote.client.grpc.timeout=6000 \ + -Dnacos.remote.client.grpc.server.check.timeout=6000 \ + -Dnacos.remote.client.grpc.health.timeout=6000 \ + --add-opens java.base/java.lang.invoke=ALL-UNNAMED \ + --add-opens java.base/java.io=ALL-UNNAMED \ + --add-opens java.base/java.math=ALL-UNNAMED \ + --add-opens java.base/java.net=ALL-UNNAMED \ + --add-opens java.base/java.nio=ALL-UNNAMED \ + --add-opens java.base/java.security=ALL-UNNAMED \ + --add-opens java.base/java.text=ALL-UNNAMED \ + --add-opens java.base/java.time=ALL-UNNAMED \ + --add-opens java.base/java.util=ALL-UNNAMED \ + --add-opens java.base/jdk.internal.access=ALL-UNNAMED \ + --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \ + $JVM_OPTION \ + -jar /application/service.jar \ + --server.port=$SERVER_PORT \ + --spring.profiles.active=$SERVER_PROFILE_ACTIVE diff --git a/rc-service/rc-service-console/Dockerfile b/rc-service/rc-service-console/Dockerfile index 8fb3971..9e8d0af 100644 --- a/rc-service/rc-service-console/Dockerfile +++ b/rc-service/rc-service-console/Dockerfile @@ -1,36 +1,36 @@ -#FROM openjdk:17 -FROM 989328288674.dkr.ecr.ap-southeast-1.amazonaws.com/likei-dev:amazoncorretto-17 -MAINTAINER pengliang - -ARG SERVICE_VERSION="v1" -ENV RC_SERVICE_NAME "rc-service-console" -ENV RC_SERVICE_VERSION $SERVICE_VERSION - -ENV JVM_OPTION "-XX:InitialRAMPercentage=65.0 -XX:MaxRAMPercentage=65.0" -ENV SERVER_PORT="9000" -ENV SERVER_PROFILE_ACTIVE "prod" - -RUN mkdir -p /application -WORKDIR application -COPY console-start/target/rc-service-console-*.jar service.jar - -ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ - -Dnacos.remote.client.grpc.timeout=6000 \ - -Dnacos.remote.client.grpc.server.check.timeout=6000 \ - -Dnacos.remote.client.grpc.health.timeout=6000 \ - --add-opens java.base/java.lang.invoke=ALL-UNNAMED \ - --add-opens java.base/java.io=ALL-UNNAMED \ - --add-opens java.base/java.math=ALL-UNNAMED \ - --add-opens java.base/java.net=ALL-UNNAMED \ - --add-opens java.base/java.nio=ALL-UNNAMED \ - --add-opens java.base/java.security=ALL-UNNAMED \ - --add-opens java.base/java.text=ALL-UNNAMED \ - --add-opens java.base/java.time=ALL-UNNAMED \ - --add-opens java.base/java.util=ALL-UNNAMED \ - --add-opens java.base/jdk.internal.access=ALL-UNNAMED \ - --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \ - $JVM_OPTION \ - -jar /application/service.jar \ - --server.port=$SERVER_PORT \ - --spring.profiles.active=$SERVER_PROFILE_ACTIVE - +FROM eclipse-temurin:17-jre-jammy + +ARG SERVICE_VERSION="dev" +ENV RC_SERVICE_NAME="rc-service-console" +ENV RC_SERVICE_VERSION="${SERVICE_VERSION}" + +ENV JVM_OPTION="-XX:InitialRAMPercentage=65.0 -XX:MaxRAMPercentage=65.0" +ENV SERVER_PORT="9000" +ENV SERVER_PROFILE_ACTIVE="prod" + +RUN apt-get update \ + && apt-get install -y --no-install-recommends wget ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /application +COPY console-start/target/rc-service-console-*.jar /application/service.jar + +ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ + -Dnacos.remote.client.grpc.timeout=6000 \ + -Dnacos.remote.client.grpc.server.check.timeout=6000 \ + -Dnacos.remote.client.grpc.health.timeout=6000 \ + --add-opens java.base/java.lang.invoke=ALL-UNNAMED \ + --add-opens java.base/java.io=ALL-UNNAMED \ + --add-opens java.base/java.math=ALL-UNNAMED \ + --add-opens java.base/java.net=ALL-UNNAMED \ + --add-opens java.base/java.nio=ALL-UNNAMED \ + --add-opens java.base/java.security=ALL-UNNAMED \ + --add-opens java.base/java.text=ALL-UNNAMED \ + --add-opens java.base/java.time=ALL-UNNAMED \ + --add-opens java.base/java.util=ALL-UNNAMED \ + --add-opens java.base/jdk.internal.access=ALL-UNNAMED \ + --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \ + $JVM_OPTION \ + -jar /application/service.jar \ + --server.port=$SERVER_PORT \ + --spring.profiles.active=$SERVER_PROFILE_ACTIVE diff --git a/rc-service/rc-service-external/Dockerfile b/rc-service/rc-service-external/Dockerfile index de239e5..d8d21c3 100644 --- a/rc-service/rc-service-external/Dockerfile +++ b/rc-service/rc-service-external/Dockerfile @@ -1,35 +1,36 @@ -#FROM openjdk:17 -FROM 989328288674.dkr.ecr.ap-southeast-1.amazonaws.com/likei-dev:amazoncorretto-17 - - -ARG SERVICE_VERSION="v1" -ENV RC_SERVICE_NAME "rc-service-external" -ENV RC_SERVICE_VERSION $SERVICE_VERSION - -ENV JVM_OPTION "-XX:InitialRAMPercentage=65.0 -XX:MaxRAMPercentage=65.0" -ENV SERVER_PORT="9000" -ENV SERVER_PROFILE_ACTIVE "prod" - -RUN mkdir -p /application -WORKDIR application -COPY external-start/target/rc-service-external-*.jar service.jar - -ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ - -Dnacos.remote.client.grpc.timeout=6000 \ - -Dnacos.remote.client.grpc.server.check.timeout=6000 \ - -Dnacos.remote.client.grpc.health.timeout=6000 \ - --add-opens java.base/java.lang.invoke=ALL-UNNAMED \ - --add-opens java.base/java.io=ALL-UNNAMED \ - --add-opens java.base/java.math=ALL-UNNAMED \ - --add-opens java.base/java.net=ALL-UNNAMED \ - --add-opens java.base/java.nio=ALL-UNNAMED \ - --add-opens java.base/java.security=ALL-UNNAMED \ - --add-opens java.base/java.text=ALL-UNNAMED \ - --add-opens java.base/java.time=ALL-UNNAMED \ - --add-opens java.base/java.util=ALL-UNNAMED \ - --add-opens java.base/jdk.internal.access=ALL-UNNAMED \ - --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \ - $JVM_OPTION \ - -jar /application/service.jar \ - --server.port=$SERVER_PORT \ - --spring.profiles.active=$SERVER_PROFILE_ACTIVE +FROM eclipse-temurin:17-jre-jammy + +ARG SERVICE_VERSION="dev" +ENV RC_SERVICE_NAME="rc-service-external" +ENV RC_SERVICE_VERSION="${SERVICE_VERSION}" + +ENV JVM_OPTION="-XX:InitialRAMPercentage=65.0 -XX:MaxRAMPercentage=65.0" +ENV SERVER_PORT="9000" +ENV SERVER_PROFILE_ACTIVE="prod" + +RUN apt-get update \ + && apt-get install -y --no-install-recommends wget ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /application +COPY external-start/target/rc-service-external-*.jar /application/service.jar + +ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ + -Dnacos.remote.client.grpc.timeout=6000 \ + -Dnacos.remote.client.grpc.server.check.timeout=6000 \ + -Dnacos.remote.client.grpc.health.timeout=6000 \ + --add-opens java.base/java.lang.invoke=ALL-UNNAMED \ + --add-opens java.base/java.io=ALL-UNNAMED \ + --add-opens java.base/java.math=ALL-UNNAMED \ + --add-opens java.base/java.net=ALL-UNNAMED \ + --add-opens java.base/java.nio=ALL-UNNAMED \ + --add-opens java.base/java.security=ALL-UNNAMED \ + --add-opens java.base/java.text=ALL-UNNAMED \ + --add-opens java.base/java.time=ALL-UNNAMED \ + --add-opens java.base/java.util=ALL-UNNAMED \ + --add-opens java.base/jdk.internal.access=ALL-UNNAMED \ + --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \ + $JVM_OPTION \ + -jar /application/service.jar \ + --server.port=$SERVER_PORT \ + --spring.profiles.active=$SERVER_PROFILE_ACTIVE diff --git a/rc-service/rc-service-live/Dockerfile b/rc-service/rc-service-live/Dockerfile index 86c7ac1..e688ce7 100644 --- a/rc-service/rc-service-live/Dockerfile +++ b/rc-service/rc-service-live/Dockerfile @@ -1,34 +1,36 @@ -#FROM openjdk:17 -FROM 989328288674.dkr.ecr.ap-southeast-1.amazonaws.com/likei-dev:amazoncorretto-17 - -ARG SERVICE_VERSION="v1" -ENV RC_SERVICE_NAME "rc-service-live" -ENV RC_SERVICE_VERSION $SERVICE_VERSION - -ENV SERVER_PORT="9000" -ENV SERVER_PROFILE_ACTIVE "prod" -ENV JVM_OPTION "-XX:InitialRAMPercentage=65.0 -XX:MaxRAMPercentage=65.0" - -RUN mkdir -p /application -WORKDIR application -COPY live-start/target/rc-service-live-*.jar service.jar - -ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ - -Dnacos.remote.client.grpc.timeout=6000 \ - -Dnacos.remote.client.grpc.server.check.timeout=6000 \ - -Dnacos.remote.client.grpc.health.timeout=6000 \ - --add-opens java.base/java.lang.invoke=ALL-UNNAMED \ - --add-opens java.base/java.io=ALL-UNNAMED \ - --add-opens java.base/java.math=ALL-UNNAMED \ - --add-opens java.base/java.net=ALL-UNNAMED \ - --add-opens java.base/java.nio=ALL-UNNAMED \ - --add-opens java.base/java.security=ALL-UNNAMED \ - --add-opens java.base/java.text=ALL-UNNAMED \ - --add-opens java.base/java.time=ALL-UNNAMED \ - --add-opens java.base/java.util=ALL-UNNAMED \ - --add-opens java.base/jdk.internal.access=ALL-UNNAMED \ - --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \ - $JVM_OPTION \ - -jar /application/service.jar \ - --server.port=$SERVER_PORT \ - --spring.profiles.active=$SERVER_PROFILE_ACTIVE +FROM eclipse-temurin:17-jre-jammy + +ARG SERVICE_VERSION="dev" +ENV RC_SERVICE_NAME="rc-service-live" +ENV RC_SERVICE_VERSION="${SERVICE_VERSION}" + +ENV SERVER_PORT="9000" +ENV SERVER_PROFILE_ACTIVE="prod" +ENV JVM_OPTION="-XX:InitialRAMPercentage=65.0 -XX:MaxRAMPercentage=65.0" + +RUN apt-get update \ + && apt-get install -y --no-install-recommends wget ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /application +COPY live-start/target/rc-service-live-*.jar /application/service.jar + +ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ + -Dnacos.remote.client.grpc.timeout=6000 \ + -Dnacos.remote.client.grpc.server.check.timeout=6000 \ + -Dnacos.remote.client.grpc.health.timeout=6000 \ + --add-opens java.base/java.lang.invoke=ALL-UNNAMED \ + --add-opens java.base/java.io=ALL-UNNAMED \ + --add-opens java.base/java.math=ALL-UNNAMED \ + --add-opens java.base/java.net=ALL-UNNAMED \ + --add-opens java.base/java.nio=ALL-UNNAMED \ + --add-opens java.base/java.security=ALL-UNNAMED \ + --add-opens java.base/java.text=ALL-UNNAMED \ + --add-opens java.base/java.time=ALL-UNNAMED \ + --add-opens java.base/java.util=ALL-UNNAMED \ + --add-opens java.base/jdk.internal.access=ALL-UNNAMED \ + --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \ + $JVM_OPTION \ + -jar /application/service.jar \ + --server.port=$SERVER_PORT \ + --spring.profiles.active=$SERVER_PROFILE_ACTIVE diff --git a/rc-service/rc-service-order/Dockerfile b/rc-service/rc-service-order/Dockerfile index 31b0387..a420df2 100644 --- a/rc-service/rc-service-order/Dockerfile +++ b/rc-service/rc-service-order/Dockerfile @@ -1,34 +1,36 @@ -#FROM openjdk:17 -FROM 989328288674.dkr.ecr.ap-southeast-1.amazonaws.com/likei-dev:amazoncorretto-17 - -ARG SERVICE_VERSION="v1" -ENV RC_SERVICE_NAME "rc-service-order" -ENV RC_SERVICE_VERSION $SERVICE_VERSION - -ENV JVM_OPTION "-XX:InitialRAMPercentage=65.0 -XX:MaxRAMPercentage=65.0" -ENV SERVER_PORT="9000" -ENV SERVER_PROFILE_ACTIVE "prod" - -RUN mkdir -p /application -WORKDIR application -COPY order-start/target/rc-service-order-*.jar service.jar - -ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ - -Dnacos.remote.client.grpc.timeout=6000 \ - -Dnacos.remote.client.grpc.server.check.timeout=6000 \ - -Dnacos.remote.client.grpc.health.timeout=6000 \ - --add-opens java.base/java.lang.invoke=ALL-UNNAMED \ - --add-opens java.base/java.io=ALL-UNNAMED \ - --add-opens java.base/java.math=ALL-UNNAMED \ - --add-opens java.base/java.net=ALL-UNNAMED \ - --add-opens java.base/java.nio=ALL-UNNAMED \ - --add-opens java.base/java.security=ALL-UNNAMED \ - --add-opens java.base/java.text=ALL-UNNAMED \ - --add-opens java.base/java.time=ALL-UNNAMED \ - --add-opens java.base/java.util=ALL-UNNAMED \ - --add-opens java.base/jdk.internal.access=ALL-UNNAMED \ - --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \ - $JVM_OPTION \ - -jar /application/service.jar \ - --server.port=$SERVER_PORT \ - --spring.profiles.active=$SERVER_PROFILE_ACTIVE +FROM eclipse-temurin:17-jre-jammy + +ARG SERVICE_VERSION="dev" +ENV RC_SERVICE_NAME="rc-service-order" +ENV RC_SERVICE_VERSION="${SERVICE_VERSION}" + +ENV JVM_OPTION="-XX:InitialRAMPercentage=65.0 -XX:MaxRAMPercentage=65.0" +ENV SERVER_PORT="9000" +ENV SERVER_PROFILE_ACTIVE="prod" + +RUN apt-get update \ + && apt-get install -y --no-install-recommends wget ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /application +COPY order-start/target/rc-service-order-*.jar /application/service.jar + +ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ + -Dnacos.remote.client.grpc.timeout=6000 \ + -Dnacos.remote.client.grpc.server.check.timeout=6000 \ + -Dnacos.remote.client.grpc.health.timeout=6000 \ + --add-opens java.base/java.lang.invoke=ALL-UNNAMED \ + --add-opens java.base/java.io=ALL-UNNAMED \ + --add-opens java.base/java.math=ALL-UNNAMED \ + --add-opens java.base/java.net=ALL-UNNAMED \ + --add-opens java.base/java.nio=ALL-UNNAMED \ + --add-opens java.base/java.security=ALL-UNNAMED \ + --add-opens java.base/java.text=ALL-UNNAMED \ + --add-opens java.base/java.time=ALL-UNNAMED \ + --add-opens java.base/java.util=ALL-UNNAMED \ + --add-opens java.base/jdk.internal.access=ALL-UNNAMED \ + --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \ + $JVM_OPTION \ + -jar /application/service.jar \ + --server.port=$SERVER_PORT \ + --spring.profiles.active=$SERVER_PROFILE_ACTIVE diff --git a/rc-service/rc-service-other/Dockerfile b/rc-service/rc-service-other/Dockerfile index 1167c52..cca1c51 100644 --- a/rc-service/rc-service-other/Dockerfile +++ b/rc-service/rc-service-other/Dockerfile @@ -1,33 +1,36 @@ -#FROM openjdk:17 -FROM 989328288674.dkr.ecr.ap-southeast-1.amazonaws.com/likei-dev:amazoncorretto-17 -ARG SERVICE_VERSION="v1" -ENV RC_SERVICE_NAME "rc-service-other" -ENV RC_SERVICE_VERSION $SERVICE_VERSION - -ENV SERVER_PORT="9000" -ENV SERVER_PROFILE_ACTIVE "prod" -ENV JVM_OPTION "-XX:InitialRAMPercentage=65.0 -XX:MaxRAMPercentage=65.0" - -RUN mkdir -p /application /logs -WORKDIR application -COPY other-start/target/rc-service-other-*.jar service.jar - -ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ - -Dnacos.remote.client.grpc.timeout=6000 \ - -Dnacos.remote.client.grpc.server.check.timeout=6000 \ - -Dnacos.remote.client.grpc.health.timeout=6000 \ - --add-opens java.base/java.lang.invoke=ALL-UNNAMED \ - --add-opens java.base/java.io=ALL-UNNAMED \ - --add-opens java.base/java.math=ALL-UNNAMED \ - --add-opens java.base/java.net=ALL-UNNAMED \ - --add-opens java.base/java.nio=ALL-UNNAMED \ - --add-opens java.base/java.security=ALL-UNNAMED \ - --add-opens java.base/java.text=ALL-UNNAMED \ - --add-opens java.base/java.time=ALL-UNNAMED \ - --add-opens java.base/java.util=ALL-UNNAMED \ - --add-opens java.base/jdk.internal.access=ALL-UNNAMED \ - --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \ - $JVM_OPTION \ - -jar /application/service.jar \ - --server.port=$SERVER_PORT \ - --spring.profiles.active=$SERVER_PROFILE_ACTIVE +FROM eclipse-temurin:17-jre-jammy + +ARG SERVICE_VERSION="dev" +ENV RC_SERVICE_NAME="rc-service-other" +ENV RC_SERVICE_VERSION="${SERVICE_VERSION}" + +ENV SERVER_PORT="9000" +ENV SERVER_PROFILE_ACTIVE="prod" +ENV JVM_OPTION="-XX:InitialRAMPercentage=65.0 -XX:MaxRAMPercentage=65.0" + +RUN apt-get update \ + && apt-get install -y --no-install-recommends wget ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /application +COPY other-start/target/rc-service-other-*.jar /application/service.jar + +ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ + -Dnacos.remote.client.grpc.timeout=6000 \ + -Dnacos.remote.client.grpc.server.check.timeout=6000 \ + -Dnacos.remote.client.grpc.health.timeout=6000 \ + --add-opens java.base/java.lang.invoke=ALL-UNNAMED \ + --add-opens java.base/java.io=ALL-UNNAMED \ + --add-opens java.base/java.math=ALL-UNNAMED \ + --add-opens java.base/java.net=ALL-UNNAMED \ + --add-opens java.base/java.nio=ALL-UNNAMED \ + --add-opens java.base/java.security=ALL-UNNAMED \ + --add-opens java.base/java.text=ALL-UNNAMED \ + --add-opens java.base/java.time=ALL-UNNAMED \ + --add-opens java.base/java.util=ALL-UNNAMED \ + --add-opens java.base/jdk.internal.access=ALL-UNNAMED \ + --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \ + $JVM_OPTION \ + -jar /application/service.jar \ + --server.port=$SERVER_PORT \ + --spring.profiles.active=$SERVER_PROFILE_ACTIVE diff --git a/rc-service/rc-service-wallet/Dockerfile b/rc-service/rc-service-wallet/Dockerfile index da69029..2350f0e 100644 --- a/rc-service/rc-service-wallet/Dockerfile +++ b/rc-service/rc-service-wallet/Dockerfile @@ -1,34 +1,36 @@ -#FROM openjdk:17 -FROM 989328288674.dkr.ecr.ap-southeast-1.amazonaws.com/likei-dev:amazoncorretto-17 - -ARG SERVICE_VERSION="v1" -ENV RC_SERVICE_NAME "rc-service-wallet" -ENV RC_SERVICE_VERSION $SERVICE_VERSION - -ENV SERVER_PORT="9000" -ENV SERVER_PROFILE_ACTIVE "prod" -ENV JVM_OPTION "-XX:InitialRAMPercentage=65.0 -XX:MaxRAMPercentage=65.0" - -RUN mkdir -p /application -WORKDIR application -COPY wallet-start/target/rc-service-wallet-*.jar service.jar - -ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ - -Dnacos.remote.client.grpc.timeout=6000 \ - -Dnacos.remote.client.grpc.server.check.timeout=6000 \ - -Dnacos.remote.client.grpc.health.timeout=6000 \ - --add-opens java.base/java.lang.invoke=ALL-UNNAMED \ - --add-opens java.base/java.io=ALL-UNNAMED \ - --add-opens java.base/java.math=ALL-UNNAMED \ - --add-opens java.base/java.net=ALL-UNNAMED \ - --add-opens java.base/java.nio=ALL-UNNAMED \ - --add-opens java.base/java.security=ALL-UNNAMED \ - --add-opens java.base/java.text=ALL-UNNAMED \ - --add-opens java.base/java.time=ALL-UNNAMED \ - --add-opens java.base/java.util=ALL-UNNAMED \ - --add-opens java.base/jdk.internal.access=ALL-UNNAMED \ - --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \ - $JVM_OPTION \ - -jar /application/service.jar \ - --server.port=$SERVER_PORT \ - --spring.profiles.active=$SERVER_PROFILE_ACTIVE +FROM eclipse-temurin:17-jre-jammy + +ARG SERVICE_VERSION="dev" +ENV RC_SERVICE_NAME="rc-service-wallet" +ENV RC_SERVICE_VERSION="${SERVICE_VERSION}" + +ENV SERVER_PORT="9000" +ENV SERVER_PROFILE_ACTIVE="prod" +ENV JVM_OPTION="-XX:InitialRAMPercentage=65.0 -XX:MaxRAMPercentage=65.0" + +RUN apt-get update \ + && apt-get install -y --no-install-recommends wget ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /application +COPY wallet-start/target/rc-service-wallet-*.jar /application/service.jar + +ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \ + -Dnacos.remote.client.grpc.timeout=6000 \ + -Dnacos.remote.client.grpc.server.check.timeout=6000 \ + -Dnacos.remote.client.grpc.health.timeout=6000 \ + --add-opens java.base/java.lang.invoke=ALL-UNNAMED \ + --add-opens java.base/java.io=ALL-UNNAMED \ + --add-opens java.base/java.math=ALL-UNNAMED \ + --add-opens java.base/java.net=ALL-UNNAMED \ + --add-opens java.base/java.nio=ALL-UNNAMED \ + --add-opens java.base/java.security=ALL-UNNAMED \ + --add-opens java.base/java.text=ALL-UNNAMED \ + --add-opens java.base/java.time=ALL-UNNAMED \ + --add-opens java.base/java.util=ALL-UNNAMED \ + --add-opens java.base/jdk.internal.access=ALL-UNNAMED \ + --add-opens java.base/jdk.internal.misc=ALL-UNNAMED \ + $JVM_OPTION \ + -jar /application/service.jar \ + --server.port=$SERVER_PORT \ + --spring.profiles.active=$SERVER_PROFILE_ACTIVE