deploy: align container java defaults
This commit is contained in:
@@ -5,7 +5,7 @@ ARG APP_VERSION
|
|||||||
|
|
||||||
ENV APP_NAME=${APP_NAME}
|
ENV APP_NAME=${APP_NAME}
|
||||||
ENV APP_VERSION=${APP_VERSION}
|
ENV APP_VERSION=${APP_VERSION}
|
||||||
ENV JAVA_OPTS=""
|
ENV JAVA_OPTS="--sun-misc-unsafe-memory-access=allow"
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY modules/apps/${APP_NAME}/target/${APP_NAME}.jar /app/app.jar
|
COPY modules/apps/${APP_NAME}/target/${APP_NAME}.jar /app/app.jar
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ version: "3.8"
|
|||||||
# main-0.1.0-SNAPSHOT-22468e7
|
# main-0.1.0-SNAPSHOT-22468e7
|
||||||
x-common-env: &common-env
|
x-common-env: &common-env
|
||||||
TZ: Asia/Shanghai
|
TZ: Asia/Shanghai
|
||||||
JAVA_OPTS: ${JAVA_OPTS:--XX:+UseZGC -XX:MaxRAMPercentage=75}
|
JAVA_OPTS: ${JAVA_OPTS:---sun-misc-unsafe-memory-access=allow -XX:+UseZGC -XX:MaxRAMPercentage=75}
|
||||||
NACOS_CONFIG_ENABLED: ${NACOS_CONFIG_ENABLED:-true}
|
NACOS_CONFIG_ENABLED: ${NACOS_CONFIG_ENABLED:-true}
|
||||||
NACOS_SERVER_ADDR: ${NACOS_SERVER_ADDR:-127.0.0.1:8848}
|
NACOS_SERVER_ADDR: ${NACOS_SERVER_ADDR:-127.0.0.1:8848}
|
||||||
NACOS_NAMESPACE: ${NACOS_NAMESPACE:-}
|
NACOS_NAMESPACE: ${NACOS_NAMESPACE:-}
|
||||||
|
|||||||
@@ -36,6 +36,17 @@ class PortainerComposeResourceLimitsTest {
|
|||||||
assertServiceMemoryLimit(compose, "vehicle-analytics-app", "VEHICLE_ANALYTICS_MEM_LIMIT", "1024m");
|
assertServiceMemoryLimit(compose, "vehicle-analytics-app", "VEHICLE_ANALYTICS_MEM_LIMIT", "1024m");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void containerDefaultsIncludeJava25UnsafeCompatibilityFlag() throws IOException {
|
||||||
|
String compose = Files.readString(repositoryRoot().resolve("deploy/portainer/docker-compose.yml"));
|
||||||
|
String dockerfile = Files.readString(repositoryRoot().resolve("Dockerfile"));
|
||||||
|
|
||||||
|
assertThat(dockerfile)
|
||||||
|
.contains("ENV JAVA_OPTS=\"--sun-misc-unsafe-memory-access=allow\"");
|
||||||
|
assertThat(commonEnvBlock(compose))
|
||||||
|
.contains("JAVA_OPTS: ${JAVA_OPTS:---sun-misc-unsafe-memory-access=allow -XX:+UseZGC -XX:MaxRAMPercentage=75}");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void gb32960ComposeExposesBothPlatformAccountsWithoutSecrets() throws IOException {
|
void gb32960ComposeExposesBothPlatformAccountsWithoutSecrets() throws IOException {
|
||||||
String compose = Files.readString(repositoryRoot().resolve("deploy/portainer/docker-compose.yml"));
|
String compose = Files.readString(repositoryRoot().resolve("deploy/portainer/docker-compose.yml"));
|
||||||
|
|||||||
Reference in New Issue
Block a user