[feat] Dockerfile, docker-compose, Kubernetes 매니페스트 추가#42
Open
dasomel wants to merge 3 commits into
Open
Conversation
The boot-sample-java-config repo has no container image definition or
Kubernetes manifests, so the sample can only be run locally via the
Maven Spring Boot plugin. Add a minimal but production-shaped set:
- Dockerfile: multi-stage Maven 3.9 + Temurin 17 -> JRE Alpine, runs as
a non-root user, exposes 8080, HEALTHCHECK against Actuator.
- .dockerignore: keep build context small.
- docker-compose.yml: single-service compose for quick demo runs, image
tag parameterised via ${APP_VERSION:-5.0.0}. The sample uses HSQLDB
in-memory so no DB sidecar is needed.
- k8s/deployment.yaml: replica=1 RollingUpdate, runAsNonRoot,
readOnlyRootFilesystem, drop ALL, resource requests/limits, separate
liveness/readiness probes against Actuator.
- k8s/service.yaml: ClusterIP exposing port 8080.
Application code and properties are unchanged.
Contributor
|
표준프레임워크에 대한 지속적인 참여에 대단히 감사드립니다. 발견 사항 — readiness / liveness probe 및 Dockerfile HEALTHCHECK 경로가 존재하지 않는 엔드포인트를 가리킴세 곳 모두
그러나 본 프로젝트 1. 애플리케이션 자체는 정상 — 대조군2. PR이 가리키는 세 경로는 전부 5003. Docker HEALTHCHECK 결과 — 컨테이너
|
4 tasks
- pom.xml에 spring-boot-starter-actuator 추가 - application.properties에 actuator health 노출 및 readiness/liveness probe 설정 - Dockerfile HEALTHCHECK, k8s readiness/liveness 세 곳 모두 /actuator/health/* 경로 유효화하여 500 → 정상화, CrashLoop 방지 - k8s/README.md 신설: 빌드·배포·접속·헬스체크 확인 절차 안내
Contributor
Author
|
리뷰 의견 반영 완료했습니다.
|
| minikube service egovframe-boot-sample-java-config --url | ||
| ``` | ||
|
|
||
| 일반 클러스터에서는 NodePort 값(기본 30080)으로 접속합니다. |
Contributor
There was a problem hiding this comment.
해당 문구가 service.yaml과 일치하지 않습니다.
Contributor
Author
|
리뷰 반영하여 k8s/README.md 4번 "접속" 섹션을 service.yaml 실제 값에 맞게 수정했습니다. 불일치 내용:
수정 내용:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경 사유
boot-sample-java-config에는 컨테이너 이미지/k8s 매니페스트가 없어 로컬에서 Maven 플러그인으로만 실행 가능합니다. 데모와 클러스터 배포 경로를 만들기 위한 최소 산출물을 추가합니다.
변경 내용
Dockerfile— multi-stagemaven:3.9-eclipse-temurin-17→eclipse-temurin:17-jre-alpine, 비루트 사용자,JAVA_OPTS=-XX:MaxRAMPercentage=75 -XX:+ExitOnOutOfMemoryError,HEALTHCHECKActuator.dockerignore—target/,k8s/, IDE 파일, README 제외docker-compose.yml— 단일 서비스 (샘플이 HSQLDB in-memory를 사용하므로 DB 사이드카 불필요),${APP_VERSION:-5.0.0}변수화k8s/deployment.yaml— 1 replica RollingUpdate, runAsNonRoot, readOnlyRootFilesystem, drop ALL, resource requests/limits, liveness/readiness probe 분리k8s/service.yaml— ClusterIP 8080영향 범위
application.properties변경 없음image:태그(egovframe-boot-sample-java-config:5.0.0)는 예시 — 운영 환경 레지스트리로 교체 필요체크리스트