feat: add platform deployment artifacts

This commit is contained in:
2026-03-25 15:08:17 +00:00
parent 3b45075e6c
commit affbb67c2b
9 changed files with 432 additions and 0 deletions

30
Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
# 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"]