mirror of
https://github.com/cna-bootcamp/lifesub.git
synced 2026-06-13 04:59:10 +00:00
add cicd
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# Build stage
|
||||
FROM openjdk:23-oraclelinux8 AS builder
|
||||
ARG BUILD_LIB_DIR
|
||||
ARG ARTIFACTORY_FILE
|
||||
COPY ${BUILD_LIB_DIR}/${ARTIFACTORY_FILE} app.jar
|
||||
|
||||
# Run stage
|
||||
FROM openjdk:23-slim
|
||||
ENV USERNAME k8s
|
||||
ENV ARTIFACTORY_HOME /home/${USERNAME}
|
||||
ENV JAVA_OPTS=""
|
||||
|
||||
# Add a non-root user
|
||||
RUN adduser --system --group ${USERNAME} && \
|
||||
mkdir -p ${ARTIFACTORY_HOME} && \
|
||||
chown ${USERNAME}:${USERNAME} ${ARTIFACTORY_HOME}
|
||||
|
||||
WORKDIR ${ARTIFACTORY_HOME}
|
||||
COPY --from=builder app.jar app.jar
|
||||
RUN chown ${USERNAME}:${USERNAME} app.jar
|
||||
|
||||
USER ${USERNAME}
|
||||
|
||||
ENTRYPOINT [ "sh", "-c" ]
|
||||
CMD ["java ${JAVA_OPTS} -jar app.jar"]
|
||||
Vendored
+1
-1
@@ -74,7 +74,7 @@ podTemplate(
|
||||
podman build \
|
||||
--build-arg BUILD_LIB_DIR="${buildDir}/build/libs" \
|
||||
--build-arg ARTIFACTORY_FILE="${jarFile}" \
|
||||
-f container/Dockerfile \
|
||||
-f deployment/Dockerfile \
|
||||
-t ${props.registry}/${props.image_org}/${service}:${imageTag} .
|
||||
|
||||
podman push ${props.registry}/${props.image_org}/${service}:${imageTag}
|
||||
|
||||
Reference in New Issue
Block a user