Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/local-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 로컬 실행

## 1) 인프라 실행

1. Docker Desktop 실행
2. 프로젝트 루트에서 아래 명령 실행
- `docker compose up -d`

기본 포트:
- PostgreSQL: `localhost:5432`
- Redis: `localhost:6379`

## 2) 백엔드 실행

- Windows: `.\gradlew bootRun`
- Mac/Linux: `./gradlew bootRun`

## 3) OAuth 로그인 테스트 (선택)

- Google/Naver/Kakao 로그인 테스트가 필요하면 로컬 환경변수에
Client ID / Client Secret 값을 설정합니다.
- 각자 본인 키를 사용하며, 실제 키 값은 git에 커밋하지 않습니다.

## 참고

- 기본 API 실행은 `application.yaml`의 local fallback 값으로 가능합니다.
- `JWT_SECRET`도 local fallback이 있어 로컬 부팅 시 필수 입력이 아닙니다.
20 changes: 10 additions & 10 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ spring:
client:
registration:
google:
client-id: ${GOOGLE_CLIENT_ID}
client-secret: ${GOOGLE_CLIENT_SECRET}
client-id: ${GOOGLE_CLIENT_ID:dummy-google-client-id}
client-secret: ${GOOGLE_CLIENT_SECRET:dummy-google-client-secret}
scope:
- profile
- email

naver:
client-id: ${NAVER_CLIENT_ID}
client-secret: ${NAVER_CLIENT_SECRET}
client-id: ${NAVER_CLIENT_ID:dummy-naver-client-id}
client-secret: ${NAVER_CLIENT_SECRET:dummy-naver-client-secret}
client-name: Naver
authorization-grant-type: authorization_code
redirect-uri: "{baseUrl}/login/oauth2/code/{registrationId}"
Expand All @@ -38,8 +38,8 @@ spring:
- profile_image

kakao:
client-id: ${KAKAO_CLIENT_ID}
client-secret: ${KAKAO_CLIENT_SECRET}
client-id: ${KAKAO_CLIENT_ID:dummy-kakao-client-id}
client-secret: ${KAKAO_CLIENT_SECRET:dummy-kakao-client-secret}
client-authentication-method: client_secret_post
client-name: Kakao
authorization-grant-type: authorization_code
Expand All @@ -63,7 +63,7 @@ spring:
user-name-attribute: id

jwt:
secret: ${JWT_SECRET}
secret: ${JWT_SECRET:change-me-local-jwt-secret-key-32bytes!}
access-token-expiration-seconds: 900
refresh-token-expiration-seconds: 2592000

Expand All @@ -75,9 +75,9 @@ spring:
import: optional:classpath:application-private.yaml

datasource:
url: jdbc:postgresql://localhost:5432/zimdugo
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
url: jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:zimdugo}
username: ${DB_USERNAME:zimdugo}
password: ${DB_PASSWORD:zimdugo}
driver-class-name: org.postgresql.Driver

data:
Expand Down
Loading