This commit is contained in:
Tour
2025-12-05 08:35:19 +01:00
parent 0ab9430f35
commit 41de6c1e8a

View File

@@ -1,29 +1,29 @@
# ==================== BUILD STAGE ====================
# Stage 1: Build
FROM maven:3.9-eclipse-temurin-25-alpine AS builder
WORKDIR /app
# Copy POM first (allows for cached dependency layer)
COPY pom.xml .
# This will now work if the opencv dependency has no classifier
# -----LOCAL----
RUN mvn dependency:resolve -B
# -----LOCAL----
# RUN mvn dependency:go-offline -B
COPY src ./src
# Updated with both properties to avoid the warning
RUN mvn package -DskipTests -Dquarkus.package.jar.type=uber-jar -Dquarkus.package.jar.enabled=true
# ==================== RUNTIME STAGE ====================
FROM eclipse-temurin:25-jre
# Stage 2: Runtime
FROM eclipse-temurin:25-jre-alpine
WORKDIR /app
# Create user BEFORE copying files (this fixes the error)
# Create user (Alpine syntax)
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
USER quarkus
EXPOSE 8081
ENTRYPOINT ["java", \
"-Dio.netty.tryReflectionSetAccessible=true", \
"--enable-native-access=ALL-UNNAMED", \
"--sun-misc-unsafe-memory-access=allow", \
"--add-opens", "java.base/java.nio=ALL-UNNAMED", \
"-jar", "app.jar"]