Skip to content

[URECA-79] Feat: Proxy 설치 검증 제거#53

Merged
40food merged 1 commit intodevelopfrom
URECA-79/Feat/render-hot-fix
Jan 28, 2026
Merged

[URECA-79] Feat: Proxy 설치 검증 제거#53
40food merged 1 commit intodevelopfrom
URECA-79/Feat/render-hot-fix

Conversation

@40food
Copy link
Copy Markdown
Contributor

@40food 40food commented Jan 28, 2026

Key Changes

  • Cloud SQL Auth Proxy 설치 때 검증 로직 제거

작업 내역

  • close:

💬 공유사항 to 리뷰어

비고

Summary by CodeRabbit

릴리스 노트

  • Chores
    • 컨테이너 배포 구성을 최적화하여 설치 프로세스를 단순화했습니다.
    • 보안 파일 권한 설정을 강화했습니다.
    • 데이터베이스 프록시 초기화 플로우를 개선했습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@40food 40food self-assigned this Jan 28, 2026
@github-actions github-actions bot changed the title Proxy 설치 검증 제거 [URECA-79] Feat: Proxy 설치 검증 제거 Jan 28, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 28, 2026

📝 Walkthrough

Walkthrough

Dockerfile이 Cloud SQL Proxy 설치 로직을 재구성했습니다. 기존의 SHA-256 체크섬 검증과 고정 경로(/usr/local/bin/) 설치를 제거하고, 작업 디렉토리에 바이너리를 다운로드하는 방식으로 변경했습니다. 빌드 시점의 CLOUD_SQL_PROXY_SHA256 ARG도 제거되었으며, 시크릿 파일 권한 설정(400)이 추가되었습니다. ENTRYPOINT는 Cloud SQL Proxy를 백그라운드로 실행한 후 Java 애플리케이션을 순차 실행하는 구조로 변경되었습니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes


리뷰 코멘트

🔒 보안 관점: 체크섬 검증 제거에 대한 우려

바이너리 무결성 검증을 제거한 점이 주목됩니다. 다운로드한 Cloud SQL Proxy의 출처를 신뢰할 수 있는지 확인이 필요합니다. 권장사항: 공식 Google Cloud 문서를 참고하여 체크섬 검증을 유지하거나, 컨테이너 이미지 스캐닝 도구(예: Trivy)로 보안성을 확보하세요.

⚙️ 프로세스 관리: 백그라운드 Proxy 실행의 한계

ENTRYPOINT에서 cloud_sql_proxy &로 백그라운드 실행 후 app.jar를 동기 실행하는 구조는 Proxy 초기화 완료 전 Java 앱이 시작될 가능성이 있습니다. 개선 방안:

  • Proxy의 헬스체크 로직을 추가하거나
  • cloud_sql_proxy 프로세스를 포어그라운드에서 래핑하는 형태로 변경하거나
  • supervisord 같은 프로세스 매니저 도입 검토

✅ 개선된 부분

시크릿 파일 권한을 명시적으로 400으로 설정한 점은 정확합니다. 비밀정보 보호 기본기를 잘 지켰네요.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 변경사항의 핵심을 명확하게 반영하고 있습니다. Cloud SQL Proxy 설치 검증 제거라는 주요 변경사항을 간결하게 요약했습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Dockerfile (1)

20-20: ENTRYPOINT 안정성 및 유지보수성 개선 필요

현재 구조에 몇 가지 개선이 필요합니다:

  1. sleep 30 대신 헬스체크 사용: 고정 대기 시간은 프록시 준비 상태를 보장하지 않습니다. 프록시가 더 빨리 준비되면 불필요한 대기가 발생하고, 네트워크 문제 시 30초로 부족할 수 있습니다.

  2. 백그라운드 프로세스 신호 전달 문제: &로 실행된 프록시와 java 앱이 동시에 실행되면 PID 1 신호 처리가 복잡해집니다. 컨테이너 종료(docker stop) 시 정상 shutdown이 보장되지 않습니다.

  3. 하드코딩된 연결 문자열: 인스턴스 연결 정보를 환경 변수로 분리하면 환경별 배포가 용이합니다.

♻️ 개선된 ENTRYPOINT 예시
+ENV CLOUD_SQL_INSTANCE="folkloric-clock-391008:asia-northeast3:ureca-3-unity"
-ENTRYPOINT ["sh", "-c", "./cloud_sql_proxy --address 127.0.0.1 --port 3306 --credentials-file /secrets/render-access.json folkloric-clock-391008:asia-northeast3:ureca-3-unity & sleep 30; java -jar app.jar"]
+ENTRYPOINT ["sh", "-c", "exec ./cloud_sql_proxy --address 127.0.0.1 --port 3306 --credentials-file /secrets/render-access.json $CLOUD_SQL_INSTANCE & \
+    until nc -z 127.0.0.1 3306 2>/dev/null; do sleep 1; done && \
+    exec java -jar app.jar"]

또는 Docker init 사용 (Dockerfile--init 플래그 또는 compose에서 init: true):

# 두 프로세스가 안정적으로 종료되도록 init 시스템 활용

참고: nc 사용을 위해 별도 설치가 필요합니다. 또는 /proc/net/tcp 확인이나 bash 기반 socket 체크도 가능합니다.

🤖 Fix all issues with AI agents
In `@Dockerfile`:
- Around line 13-14: Restore SHA-256 checksum verification for the downloaded
cloud_sql_proxy binary: after downloading into cloud_sql_proxy (from the
existing RUN step that fetches cloud-sql-proxy.linux.amd64) compute its SHA-256
and compare it against the expected hash for v2.8.1
(8c6d76380f4b7005473eb2e13991d6239f90da021cf58d91d062739479e577cf), fail the
build if it does not match, and only then chmod +x; alternatively fetch the
official checksum file and use sha256sum -c to verify the cloud_sql_proxy file
and exit non-zero on mismatch so the Docker build stops (reference: the RUN step
that creates cloud_sql_proxy and the binary name cloud_sql_proxy).

@40food 40food merged commit 8cf1a5e into develop Jan 28, 2026
3 checks passed
@40food 40food deleted the URECA-79/Feat/render-hot-fix branch January 28, 2026 14:04
@40food 40food restored the URECA-79/Feat/render-hot-fix branch January 29, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants