mirror of
https://github.com/ktds-dg0501/kt-event-marketing.git
synced 2025-12-06 10:06:24 +00:00
- GitHub Actions workflow로 백엔드 서비스 자동 빌드/배포 구성 - Kustomize를 통한 dev/staging/prod 환경별 설정 관리 - 각 마이크로서비스별 Dockerfile 추가 - 배포 자동화 스크립트 및 환경 변수 설정 - CI/CD 가이드 문서 작성
25 lines
813 B
Docker
25 lines
813 B
Docker
# Multi-stage build for Spring Boot application
|
|
FROM eclipse-temurin:21-jre-alpine AS builder
|
|
WORKDIR /app
|
|
COPY build/libs/*.jar app.jar
|
|
RUN java -Djarmode=layertools -jar app.jar extract
|
|
|
|
FROM eclipse-temurin:21-jre-alpine
|
|
WORKDIR /app
|
|
|
|
# Create non-root user
|
|
RUN addgroup -S spring && adduser -S spring -G spring
|
|
USER spring:spring
|
|
|
|
# Copy layers from builder
|
|
COPY --from=builder /app/dependencies/ ./
|
|
COPY --from=builder /app/spring-boot-loader/ ./
|
|
COPY --from=builder /app/snapshot-dependencies/ ./
|
|
COPY --from=builder /app/application/ ./
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=60s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/api/v1/events/actuator/health || exit 1
|
|
|
|
ENTRYPOINT ["java", "org.springframework.boot.loader.launch.JarLauncher"]
|