all
This commit is contained in:
20
Dockerfile
20
Dockerfile
@@ -1,29 +1,29 @@
|
|||||||
# ==================== BUILD STAGE ====================
|
# Stage 1: Build
|
||||||
FROM maven:3.9-eclipse-temurin-25-alpine AS builder
|
FROM maven:3.9-eclipse-temurin-25-alpine AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
# Copy POM first (allows for cached dependency layer)
|
# Copy POM first (allows for cached dependency layer)
|
||||||
COPY pom.xml .
|
COPY pom.xml .
|
||||||
# This will now work if the opencv dependency has no classifier
|
|
||||||
# -----LOCAL----
|
|
||||||
RUN mvn dependency:resolve -B
|
RUN mvn dependency:resolve -B
|
||||||
# -----LOCAL----
|
|
||||||
# RUN mvn dependency:go-offline -B
|
|
||||||
|
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
# Updated with both properties to avoid the warning
|
# Updated with both properties to avoid the warning
|
||||||
RUN mvn package -DskipTests -Dquarkus.package.jar.type=uber-jar -Dquarkus.package.jar.enabled=true
|
RUN mvn package -DskipTests -Dquarkus.package.jar.type=uber-jar -Dquarkus.package.jar.enabled=true
|
||||||
|
|
||||||
# ==================== RUNTIME STAGE ====================
|
# Stage 2: Runtime
|
||||||
FROM eclipse-temurin:25-jre
|
FROM eclipse-temurin:25-jre-alpine
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
# Create user BEFORE copying files (this fixes the error)
|
|
||||||
|
# Create user (Alpine syntax)
|
||||||
RUN addgroup -S quarkus && adduser -S quarkus -G quarkus
|
RUN addgroup -S quarkus && adduser -S quarkus -G quarkus
|
||||||
# Copy the built jar with correct pattern (use wildcard for any quarkus jar)
|
|
||||||
|
# Copy the built jar with correct pattern
|
||||||
COPY --from=builder --chown=quarkus:quarkus /app/target/auctiora-*.jar app.jar
|
COPY --from=builder --chown=quarkus:quarkus /app/target/auctiora-*.jar app.jar
|
||||||
|
|
||||||
USER quarkus
|
USER quarkus
|
||||||
EXPOSE 8081
|
EXPOSE 8081
|
||||||
|
|
||||||
ENTRYPOINT ["java", \
|
ENTRYPOINT ["java", \
|
||||||
"-Dio.netty.tryReflectionSetAccessible=true", \
|
"-Dio.netty.tryReflectionSetAccessible=true", \
|
||||||
"--enable-native-access=ALL-UNNAMED", \
|
"--enable-native-access=ALL-UNNAMED", \
|
||||||
"--sun-misc-unsafe-memory-access=allow", \
|
"--add-opens", "java.base/java.nio=ALL-UNNAMED", \
|
||||||
"-jar", "app.jar"]
|
"-jar", "app.jar"]
|
||||||
Reference in New Issue
Block a user