Skip to content
Snippets Groups Projects
Dockerfile.cloudbuild 640 B
Newer Older
  • Learn to ignore specific revisions
  • FROM azul/zulu-openjdk:17
    
    WORKDIR /app
    ARG PROVIDER_NAME
    ENV PROVIDER_NAME $PROVIDER_NAME
    ARG PORT
    ENV PORT $PORT
    # Copy the jar to the production image from the builder stage.
    COPY provider/notification-${PROVIDER_NAME}/target/notification-${PROVIDER_NAME}-*-spring-boot.jar notification-${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.
    
    CMD java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${PORT} -Dlog4j.formatMsgNoLookups=true -jar /app/notification-${PROVIDER_NAME}.jar