Skip to content
Snippets Groups Projects
Commit 684c6304 authored by Zhibin Mai's avatar Zhibin Mai
Browse files
parents 4cf84301 59d71531
No related branches found
No related tags found
1 merge request!572Implement Redis cache in Azure for two kinds of object caches that are...
Pipeline #196650 failed
...@@ -49,7 +49,7 @@ spec: ...@@ -49,7 +49,7 @@ spec:
{{- end }} {{- end }}
securityContext: securityContext:
allowPrivilegeEscalation: false allowPrivilegeEscalation: false
runAsUser: 0 runAsNonRoot: true
ports: ports:
- containerPort: 8080 - containerPort: 8080
resources: resources:
......
FROM azul/zulu-openjdk:8-latest FROM azul/zulu-openjdk:8-latest
WORKDIR /app WORKDIR /app
ARG PROVIDER_NAME ARG PROVIDER_NAME
ENV PROVIDER_NAME $PROVIDER_NAME ENV PROVIDER_NAME $PROVIDER_NAME
ARG PORT ARG PORT
ENV PORT $PORT ENV PORT $PORT
# Copy the jar to the production image from the builder stage. # Copy the jar to the production image from the builder stage.
COPY provider/indexer-${PROVIDER_NAME}/target/indexer-${PROVIDER_NAME}-*-spring-boot.jar indexer-${PROVIDER_NAME}.jar COPY provider/indexer-${PROVIDER_NAME}/target/indexer-${PROVIDER_NAME}-*-spring-boot.jar indexer-${PROVIDER_NAME}.jar
# Add a non-root user
RUN groupadd -g 10001 -r nonroot \
&& useradd -g 10001 -r -u 10001 nonroot
# Run as non-root user
USER 10001:10001
# Run the web service on container startup. # Run the web service on container startup.
CMD java -Djava.security.egd=indexer:/dev/./urandom -Dserver.port=${PORT} -Dlog4j.formatMsgNoLookups=true -jar /app/indexer-${PROVIDER_NAME}.jar CMD java -Djava.security.egd=indexer:/dev/./urandom -Dserver.port=${PORT} -Dlog4j.formatMsgNoLookups=true -jar /app/indexer-${PROVIDER_NAME}.jar
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment