Skip to content

Commit 3111526

Browse files
committed
✨ feat: GCP 배포 파일 추가
1 parent 4b09775 commit 3111526

File tree

3 files changed

+183
-1
lines changed

3 files changed

+183
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ bin/
4848
src/main/resources/application.yml
4949
src/main/resources/application-prod.yml
5050
src/main/resources/application-local.yml
51-
src/main/resources-env/
51+
src/main/resources-env/local

docker-compose.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
services:
2+
mysql-container:
3+
image: mysql:8.0
4+
container_name: mysql-container
5+
restart: always
6+
environment:
7+
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
8+
MYSQL_DATABASE: ittaeok
9+
MYSQL_USER: ${MYSQL_USER}
10+
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
11+
ports:
12+
- "3306:3306"
13+
volumes:
14+
- mysql_data:/var/lib/mysql
15+
networks:
16+
- app-network
17+
healthcheck:
18+
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD}"]
19+
timeout: 20s
20+
retries: 10
21+
interval: 10s
22+
start_period: 30s
23+
24+
redis-container:
25+
image: redis:8.0.3
26+
container_name: redis-container
27+
restart: always
28+
command: redis-server --requirepass ${REDIS_PASSWORD} --appendonly yes
29+
ports:
30+
- "6379:6379"
31+
volumes:
32+
- redis_data:/data
33+
networks:
34+
- app-network
35+
healthcheck:
36+
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
37+
timeout: 3s
38+
retries: 5
39+
interval: 10s
40+
start_period: 30s
41+
42+
ittaeok-container:
43+
image: # <도커 계정명/이미지 이름>/ittaeok-gcp:latest
44+
container_name: ittaeok
45+
restart: always
46+
depends_on:
47+
mysql-container:
48+
condition: service_healthy
49+
redis-container:
50+
condition: service_healthy
51+
ports:
52+
- "80:80"
53+
- "443:443"
54+
environment:
55+
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql-container:3306/ittaeok?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Seoul
56+
- SPRING_DATASOURCE_USERNAME=ittaeok_user
57+
- SPRING_DATASOURCE_PASSWORD=1234
58+
59+
- SPRING_DATA_REDIS_HOST=redis-container
60+
- SPRING_DATA_REDIS_PORT=6379
61+
- SPRING_DATA_REDIS_PASSWORD=${REDIS_PASSWORD}
62+
- SPRING_DATA_REDIS_SSL_ENABLED=false
63+
64+
- GOOGLE_APPLICATION_CREDENTIALS=${GOOGLE_APPLICATION_CREDENTIALS}
65+
- GOOGLE_CLOUD_PROJECT=${GOOGLE_CLOUD_PROJECT}
66+
67+
- SPRING_CLOUD_GCP_SECRETMANAGER_ENABLED="true"
68+
- SPRING_CLOUD_GCP_PROJECT_ID=${GOOGLE_CLOUD_PROJECT}
69+
volumes:
70+
- ./gcp-key.json:/app/gcp-key.json:ro
71+
networks:
72+
- app-network
73+
74+
volumes:
75+
mysql_data:
76+
redis_data:
77+
78+
networks:
79+
app-network:
80+
driver: bridge
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
server:
2+
port: 80
3+
4+
spring:
5+
datasource:
6+
url: ${sm://db-url}
7+
username: ${sm://db-username}
8+
password: ${sm://db-password}
9+
hikari:
10+
connection-timeout: 30000
11+
maximum-pool-size: 10
12+
driver-class-name: com.mysql.cj.jdbc.Driver
13+
jpa:
14+
hibernate:
15+
ddl-auto: update
16+
open-in-view: false
17+
properties:
18+
hibernate:
19+
jdbc:
20+
lob:
21+
non_contextual_creation: true
22+
id:
23+
new_generator_mappings: true
24+
docker:
25+
compose:
26+
lifecycle-management: start-only
27+
data:
28+
redis:
29+
host: ${sm://redis-host}
30+
port: ${sm://redis-port}
31+
username: default
32+
password: ${sm://redis-password}
33+
ssl:
34+
enabled: true
35+
security:
36+
oauth2:
37+
client:
38+
registration:
39+
google:
40+
client-name: google
41+
client-id: ${sm://google-client-id}
42+
client-secret: ${sm://google-client-secret}
43+
redirect-uri: "https://api.ittaeok.com/login/oauth2/code/{registrationId}" # SM 붙이기
44+
authorization-grant-type: authorization_code
45+
scope:
46+
- openid
47+
- email
48+
- profile
49+
kakao:
50+
client-name: kakao
51+
client-id: ${sm://kakao-client-id}
52+
client-secret: ${sm://kakao-client-secret}
53+
redirect-uri: "https://api.ittaeok.com/login/oauth2/code/{registrationId}" # SM 붙이기
54+
authorization-grant-type: authorization_code
55+
client-authentication-method: client_secret_post
56+
scope:
57+
- profile_nickname
58+
- account_email
59+
provider:
60+
kakao:
61+
authorization-uri: https://kauth.kakao.com/oauth/authorize
62+
token-uri: https://kauth.kakao.com/oauth/token
63+
user-info-uri: https://kapi.kakao.com/v2/user/me
64+
user-name-attribute: id
65+
springdoc:
66+
pathsToMatch: /api/**
67+
jwt:
68+
expiration: 604800000
69+
refresh-expiration: 704800000
70+
secret: ${sm://jwt-secret}
71+
google:
72+
calendar:
73+
client-id: ${sm://google-client-id}
74+
client-secret: ${sm://google-client-secret}
75+
redirect-uri: "https://api.ittaeok.com/oauth2/callback/google-calendar" # SM 붙이기
76+
api:
77+
key: ${sm://google-api-key}
78+
zoom:
79+
client-id: ${sm://zoom-client-id}
80+
client-secret: ${sm://zoom-client-secret}
81+
redirect-uri: ${sm://zoom-redirect-uri}
82+
refresh-token: ${sm://zoom-refresh-token}
83+
kakao:
84+
middle-location:
85+
api-key: ${sm://kakao-api-key}
86+
logging:
87+
level:
88+
org.springframework.cloud.gcp.secretmanager: DEBUG
89+
root: info
90+
org:
91+
hibernate:
92+
SQL: info
93+
type:
94+
descriptor:
95+
sql: info
96+
97+
url:
98+
backend: https://api.ittaeok.com # SM 붙이기
99+
front-server:
100+
domain-A: https://ittaeok.com # SM 붙이기
101+
domain-B: https://www.ittaeok.com # SM 붙이기
102+
redirect-url: https://ittaeok.com/auth/callback # SM 붙이기

0 commit comments

Comments
 (0)