Files
demo-kpc-2/Dockerfile
demo-bot efe2f8a209
All checks were successful
Build and Publish TechDocs / build-and-publish (push) Successful in 1m4s
Build and Push to ACR / Build and Push (push) Successful in 4m45s
feat: modernize application — source, platform artifacts, CI/CD
- chore: ingest source code

108 files from https://github.com/spring-projects/spring-petclinic
- feat: add platform deployment artifacts
- feat: add CI/CD workflow automation
2026-05-05 16:41:10 +00:00

31 lines
867 B
Docker

# Multi-stage Dockerfile for Spring Boot Application
FROM maven:3.9-eclipse-temurin-17 AS build
WORKDIR /app
# Copy dependency files first for better caching
COPY pom.xml .
RUN mvn dependency:go-offline -B
# Copy source code and build
COPY src ./src
RUN mvn clean package -DskipTests
# Runtime stage - lean JRE for Spring Boot executable JAR (~200MB vs ~500MB Tomcat)
FROM mcr.microsoft.com/openjdk/jdk:17-ubuntu
WORKDIR /app
# Create non-root user for security
RUN groupadd -g 1001 appuser && useradd -u 1001 -g appuser -s /bin/sh appuser && \
chown -R appuser:appuser /app
USER appuser
COPY --from=build /app/target/*.jar app.jar
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=30s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/actuator/health || exit 1
CMD ["java", "-jar", "app.jar"]