# 개발용 Spring Boot 백엔드 Dockerfile FROM eclipse-temurin:21-jdk-alpine WORKDIR /app # curl 설치 (헬스체크용) + postgresql16-client (회사 DB 프로비저닝 pg_dump/psql 용). # ★ 서버 PG 16.13 과 버전 맞춰야 함 — alpine 기본 postgresql-client 는 18 이라 pg_dump 18 이 # "SET transaction_timeout" (17+ 신규) 을 dump 에 포함 → 서버가 거부. 버전 고정 필수. RUN apk add --no-cache curl postgresql16-client # Gradle Wrapper 복사 및 의존성 캐싱 COPY gradlew ./ COPY gradle ./gradle RUN chmod +x gradlew COPY build.gradle settings.gradle ./ RUN ./gradlew dependencies --no-daemon || true # 소스 코드는 볼륨 마운트로 처리 EXPOSE 8081 # 개발 서버 시작 (spring-boot-devtools + continuous classes 리빌드) # 백그라운드: `./gradlew classes -t` 가 .java 변경 감지해 .class 재컴파일 # 포그라운드: `./gradlew bootRun` 이 앱 실행, DevTools 가 build/classes 변경 감지해 자동 리로드 # 주의: --continuous 는 gradle daemon 필요 → --no-daemon 제거 CMD ["sh", "-c", "./gradlew classes -t & exec ./gradlew bootRun"]