Skip to content

Commit 3af42fa

Browse files
committed
Preparing for a new conference
1 parent c986304 commit 3af42fa

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
!target/*-runner-*
33
!target/*-runner.jar
44
!target/lib/*
5+
!src
6+
!pom.xml
7+
!mvnw
8+
!.mvn
59
!target/quarkus-app/*
610
.env

Dockerfile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
####
2+
# Multi-stage Dockerfile for building and running the Quarkus application in JVM mode
3+
#
4+
# Build and run the container using:
5+
#
6+
# docker build -t quarkus/submit-jvm .
7+
# docker run -i --rm -p 8080:8080 quarkus/submit-jvm
8+
#
9+
###
10+
11+
# Stage 1: Build the application
12+
FROM registry.access.redhat.com/ubi8/openjdk-21:1.20 AS builder
13+
14+
USER root
15+
WORKDIR /build
16+
17+
# Copy Maven wrapper and pom.xml first for better layer caching
18+
COPY --chown=185 mvnw pom.xml ./
19+
COPY --chown=185 .mvn .mvn
20+
21+
# Download dependencies (cached if pom.xml unchanged)
22+
RUN ./mvnw dependency:go-offline -B
23+
24+
# Copy source code
25+
COPY --chown=185 src src
26+
27+
# Build the application
28+
RUN ./mvnw package -DskipTests -B
29+
30+
# Stage 2: Runtime image
31+
FROM registry.access.redhat.com/ubi8/openjdk-21:1.20
32+
33+
ENV LANGUAGE='en_US:en'
34+
35+
# We make four distinct layers so if there are application changes the library layers can be re-used
36+
COPY --from=builder --chown=185 /build/target/quarkus-app/lib/ /deployments/lib/
37+
COPY --from=builder --chown=185 /build/target/quarkus-app/*.jar /deployments/
38+
COPY --from=builder --chown=185 /build/target/quarkus-app/app/ /deployments/app/
39+
COPY --from=builder --chown=185 /build/target/quarkus-app/quarkus/ /deployments/quarkus/
40+
41+
EXPOSE 8080
42+
USER 185
43+
ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
44+
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
45+
46+
ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ services:
4141
- moresleep
4242

4343
cake:
44-
image: ghcr.io/javabin/cake-redux:edge
44+
image: ghcr.io/javabin/cake-redux@sha256:1010acc839eccd5694743efd676ada2ff40e0dedc6dc75025ecbc33976821a9c
4545
command: ["env-only"]
4646
ports:
4747
- "8081:8081"

0 commit comments

Comments
 (0)