Skip to content

Commit 4db1f52

Browse files
committed
Merge branch 'main' into 'github-release'
Update Dockerfile See merge request igrp-3_0/igrp-platform-access-management!52
2 parents 989fc14 + 717a296 commit 4db1f52

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

Dockerfile

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# ===================================================================
2-
# Build stage: GraalVM 23 + Native Image with Maven Wrapper
2+
# Build stage: GraalVM 21 + Native Image with Maven Wrapper
33
# ===================================================================
4-
FROM ghcr.io/graalvm/native-image-community:23 AS build
4+
FROM ghcr.io/graalvm/native-image-community:21-muslib-ol9 AS build
55

6-
# Install musl toolchain for static linking
7-
USER root
8-
RUN microdnf install musl-dev && microdnf clean all
6+
# Diretório de trabalho
7+
WORKDIR /app
98

109
# Configuração do diretório e ambiente
1110
ARG SPRING_ACTIVE_PROFILE
@@ -19,24 +18,19 @@ RUN chmod +x mvnw && ./mvnw dependency:go-offline -B
1918

2019
COPY src ./src
2120
# Compilar aplicação e gerar executável nativo completo e statico
22-
RUN ./mvnw --no-transfer-progress clean package -Dpackaging=native-image -DbuildArgs="--static --libc=musl,-Os" -DskipTests
21+
RUN ./mvnw -Pnative clean package -DskipTests -Dnative-image.options="--static --libc=musl -O2 --no-fallback"
2322

2423
# ===================================================================
25-
# Runtime stage: minimal distroless with C/C++ runtimes
24+
# Runtime stage: minimal static binary
2625
# ===================================================================
27-
FROM gcr.io/distroless/cc-debian12:nonroot
28-
29-
# Variáveis de ambiente do OpenTelemetry (ajuste conforme necessidade)
30-
ARG SPRING_ACTIVE_PROFILE
31-
ARG SERVICE_PORT=8080
32-
ENV SPRING_PROFILES_ACTIVE=${SPRING_ACTIVE_PROFILE}
26+
FROM gcr.io/distroless/static:nonroot
3327

3428
# Diretório de trabalho
3529
WORKDIR /app
3630

37-
# Copiar executável nativo do estágio de build
31+
# Copy the native executable (artifactId assumed "access-management")
3832
COPY --from=build /app/target/access-management /app/access-management
3933

4034
# Expor porta e executar aplicação
41-
EXPOSE ${SERVICE_PORT}
42-
CMD ["/app/access-management"]
35+
EXPOSE 8080
36+
CMD ["./access-management"]

0 commit comments

Comments
 (0)