File tree Expand file tree Collapse file tree 3 files changed +21
-12
lines changed
alternatives/server-micronaut-java Expand file tree Collapse file tree 3 files changed +21
-12
lines changed Original file line number Diff line number Diff line change 22FROM adoptopenjdk/openjdk11-openj9:jdk-11.0.1.13-alpine-slim as builder
33ARG SERVICE_DIR=.
44WORKDIR /service
5- COPY ${SERVICE_DIR} /service
6- RUN ./gradlew && ./gradlew copyRuntimeDeps
5+ COPY ${SERVICE_DIR} ./
6+ RUN ./gradlew build
77
88FROM adoptopenjdk/openjdk11-openj9:jdk-11.0.1.13-alpine-slim
99LABEL version=${BUILD_VERSION} \
10- company=companyname \
11- project=server-template \
12- role=client
10+ company=sandbox \
11+ project=sandbox-jukka6 \
12+ role=server
1313ENV BUILD_VERSION ${BUILD_VERSION}
1414WORKDIR /service
1515COPY --from=builder /build/libs/*.jar server.jar
16- USER daemon # TODO
16+ RUN addgroup -S micronaut && \
17+ adduser -S -D -G micronaut micronaut
18+ USER micronaut
1719EXPOSE 8080
18- # TODO: how to use secrets file in application.yml
19- CMD DATABASE_PASSWORD=$(cat /run/secrets/DATABASE_PASSWORD) java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Dcom.sun.management.jmxremote -noverify ${JAVA_OPTS} -jar server.jar
20+ # TODO: how to use secrets file in application.yml. just replace?
21+ CMD DATABASE_PASSWORD=$(cat /run/secrets/DATABASE_PASSWORD) \
22+ java \
23+ -XX:+UnlockExperimentalVMOptions \
24+ -XX:+UseCGroupMemoryLimitForHeap \
25+ -Dcom.sun.management.jmxremote \
26+ -noverify \
27+ ${JAVA_OPTS} \
28+ -jar server.jar
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ plugins {
1313version " 0.1"
1414group " server"
1515
16- project. buildDir = ' /build'
16+ project. buildDir = ' .. /build'
1717
1818repositories {
1919 mavenCentral()
@@ -97,10 +97,10 @@ tasks.withType(JavaCompile){
9797
9898task copyRuntimeDeps (type : Copy ) {
9999 from configurations. runtime
100- into ' /build/libs'
100+ into ' .. /build/libs'
101101}
102102
103103task copyGenerateDeps (type : Copy ) {
104104 from configurations. generate
105- into ' /build/gen'
105+ into ' .. /build/gen'
106106}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ ARG BUILD_VERSION
2121LABEL version=${BUILD_VERSION} \
2222 company=companyname \
2323 project=server-template \
24- role=client
24+ role=server
2525ENV BUILD_VERSION ${BUILD_VERSION}
2626ENV NODE_ENV production
2727WORKDIR /service
You can’t perform that action at this time.
0 commit comments