Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ FROM eclipse-temurin:21-jre-jammy@sha256:fcf98f8a669c2778b2a1a145c7dac92a1f8fc71
RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
rm -rf /var/lib/apt/lists/* && \
groupadd --system spring && \
useradd --system --gid spring --create-home --home-dir /app spring
groupadd --system --gid 10001 spring && \
useradd --system --uid 10001 --gid 10001 --create-home --home-dir /app spring

WORKDIR /app

Expand All @@ -49,7 +49,7 @@ COPY --chown=spring:spring --from=builder /workspace/extracted/application/ ./

EXPOSE 8080

USER spring
USER 10001:10001

HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
CMD curl --fail --silent http://127.0.0.1:8080/actuator/health > /dev/null || exit 1
Expand Down
2 changes: 2 additions & 0 deletions k8s/dev/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ spec:
automountServiceAccountToken: false
securityContext:
runAsNonRoot: true
runAsUser: 10001
runAsGroup: 10001
seccompProfile:
type: RuntimeDefault
containers:
Expand Down
1 change: 1 addition & 0 deletions k8s/dev/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
kind: Secret
metadata:
name: auth-server-secret
namespace: auth-dev
type: Opaque
stringData:
APP_DATASOURCE_USERNAME: project_auth
Expand Down