Skip to content

๐Ÿถ๋ฐ˜๋ ค ๋™๋ฌผ ์ˆ˜์ œ ๊ฐ„์‹ ๋ ˆ์‹œํ”ผ ์ œ๊ณต ์„œ๋น„์Šค

Notifications You must be signed in to change notification settings

Gaebab-Baragi/GaeBabBaragi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

I. ๊ฐœ์š”

์†Œ๊ฐœ ์˜์ƒ

1. ํ”„๋กœ์ ํŠธ ๊ฐœ์š”

๊ฑด์‹ ์‚ฌ๋ฃŒ๋„, ์Šต์‹ ์‚ฌ๋ฃŒ๋„ ๋จน์ง€ ์•Š๋Š” ๊ฐœ ๊ฐ„์‹์€ ๋จน๋Š”๋ฐ ๊ฑด๊ฐ•์— ์ข‹์€์ง€ ๋ชจ๋ฆ„ ์ง์ ‘ ๋งŒ๋“ค์–ด์ฃผ๊ณ  ์‹ถ์€๋ฐ ์š”๋ฆฌ๋ฅผ ์ž˜ ๋ชปํ•จ ์ฟ ํ‚น ํด๋ž˜์Šค๋ฅผ ๊ฐ€๋ณด๋ ค๊ณ  ํ•ด๋„ ๋„ˆ๋ฌด ๋ณธ๊ฒฉ์ ์ž„.

2. ํ”„๋กœ์ ํŠธ ์‚ฌ์šฉ ๋„๊ตฌ ๋ฐ ๋ฒ„์ „

  • OS: Windows 10
  • IDE: IntelliJ, VSCode
  • Build Automation Tool: Gradle(v8.1.1)
  • Frontend: Node.js(v18.17.0), React(v9.6.7)
  • Backend: Spring boot(v3.1.1), Spring data JPA(v3.1.1), Spring Security(v6.1.1), Flask(v2.3.2)
  • Database: h2(develop, v1.4.2), postgreSQL(deploy, v.15.3)
  • JVM: azul-17
  • WS: nginx(reverse proxy, v1.18.0)
  • WAS : tomcat(spring-boot)
  • WebRTC : OpenVidu(v2.28.0)
  • CI/CD : Jenkins
  • ์„œ๋ฒ„: AWS EC2 Ubuntu 20.04 LTS
  • Cloud Storage : Amazon S3
  • ์ด์Šˆ ๊ด€๋ฆฌ: Jira
  • ํ˜•์ƒ ๊ด€๋ฆฌ: GitLab โ€ƒ

II. ๋นŒ๋“œ

1. ๋นŒ๋“œ ํ™˜๊ฒฝ ๋ณ€์ˆ˜

a) VERSION=$(curlโ€”silent https://api.github.com/repos/docker/compose/releases/latest | jq .name -r) : Docker-compose์˜ ์ตœ์‹  ๋ฆด๋ฆฌ์ฆˆ ์ •๋ณด

b) DESTINATION=/usr/bin/docker-compose : docker-compose ์‹คํ–‰ ํŒŒ์ผ์ด ์ €์žฅ๋  ์œ„์น˜

c) Docker-compse โ€“p frontend build : Docker-compose๋Š” ๋ณดํ†ต docker-compose.yml์ด ์ €์žฅ ๋œ ๋””๋ ‰ํ† ๋ฆฌ ๋ช…์„ ํ™˜๊ฒฝ๋ณ€์ˆ˜๋กœ ์„ค์ •ํ•˜๋Š”๋ฐ ๋ณธ ํ”„๋กœ์ ํŠธ์—์„œ๋Š” docker-compose.yml์ด root์— ์žˆ์–ด ์ด๋Ÿฌํ•œ ์ž๋™ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ์„ค์ •์ด ๋˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— โ€“p ๋ฅผ ์ด์šฉํ•ด frontend๋ผ๊ณ  ์ˆ˜๋™์œผ๋กœ ๋ช…๋ช…ํ•ด์ฃผ์—ˆ๋‹ค

2. ๋ฐฐํฌ ์ˆœ์„œ

a) sudo su
b) cd /opt/openvidu
c) ./openvidu start
d) cd /
e) sudo docker-compose โ€“p frontend build
f) sudo docker-compose โ€“p frontend up โ€“d
g) sudo service nginx restart

3. ๋ฐฐํฌ ์‹œ ํŠน์ด์‚ฌํ•ญ

a) Docker ์‚ฌ์šฉ: Backend, Frontend, Nginx, Jenkins, YoloV5, OpenVidu, DB๋ฅผ ๊ฐ๊ฐ์˜ Docker Container๋กœ ๊ด€๋ฆฌํ•˜์—ฌ ๋…๋ฆฝ์„ฑ์„ ๋ณด์žฅ์‹œ์ผฐ๋‹ค.
b) Docker-compose ์‚ฌ์šฉ: Docker-compose๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ฐ๊ฐ์˜ Dockerfile์„ ํ†ตํ•ด ์—ฌ๋Ÿฌ ๊ฐœ์˜ ์ปจํ…Œ์ด๋„ˆ๋ฅผ build ํ›„ ์ƒ์„ฑํ•˜์—ฌ ๋‹ค์ค‘ ์ปจํ…Œ์ด๋„ˆ ๊ด€๋ฆฌ, ์„ค์ •์˜ ์ผ๊ด€์„ฑ, ๊ฐœ๋ฐœ ํšจ์œจ์„ฑ์„ ์ฆ๋Œ€์‹œ์ผฐ๋‹ค.
c) Jenkins pipeline ์‚ฌ์šฉ: jenkins pipeline์œผ๋กœ ํ•œ ํ”„๋กœ์ ํŠธ์— ์žˆ๋Š” backend๋‹จ๊ณผ frontend๋‹จ์„ ๋™์‹œ์— ์ž๋™ ๋ฐฐํฌ ํ•˜์—ฌ ๋ฐฐํฌ ํ™˜๊ฒฝ ํ…Œ์ŠคํŠธ ํšจ์œจ์„ฑ์„ ์ฆ๊ฐ€์‹œ์ผฐ๋‹ค.
d) Nginx์˜ reverse proxy ์‚ฌ์šฉ: ๊ฐ€๋น„์•„์—์„œ ๊ตฌ์ž…ํ•œ doggy-yummy ๋„๋ฉ”์ธ ๋’ค์— /, /api, /v1 ๊ฒฝ๋กœ๋กœ reverse proxy ํ•˜์—ฌ ๊ฐ๊ฐ front, back, object detection ๋‹จ์œผ๋กœ ๋ณด๋‚ด์ฃผ์—ˆ๋‹ค.
e) ๋ฐฐํฌ ์‹œ์—๋Š” application-secure.properties์˜ current.front, current.back์„ ${deploy.front}, ${deploy.back}์œผ๋กœ ๋ฐ”๊ฟ”์ฃผ์–ด์•ผ ํ•œ๋‹ค.

III. ์™ธ๋ถ€ ์„œ๋น„์Šค ์ •๋ณด

1. ์†Œ์…œ ์ธ์ฆ

a) ๊ตฌ๊ธ€

  • https://console.cloud.google.com/apis/dashboard
  • ๋กœ๊ทธ์ธ ํ›„ ์‚ฌ์šฉ์ž ์ธ์ฆ ์ •๋ณด โ€“ Oauth2.0 ํด๋ผ์ด์–ธํŠธ ID์— ์ถ”๊ฐ€
  • ์•ฑ ์ด๋ฆ„ ๋“ฑ๋ก
  • ์Šน์ธ๋œ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์›๋ณธ ์ถ”๊ฐ€
  • ์Šน์ธ๋œ ๋ฆฌ๋””๋ ‰์…˜ URI์ถ”๊ฐ€

b) ๋„ค์ด๋ฒ„

  • https://developers.naver.com/products/login/api/api.md
  • ๋กœ๊ทธ์ธ ํ›„ ์•ฑ ์ถ”๊ฐ€
  • Application-๋‚ด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜-๊ฐœ์š”-์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ •๋ณด์—์„œ Client Id, Client Secret์„ ๋ณต์‚ฌํ•ด application-secure.properties์˜ spring.security.oauth2.client.registration.naver.client-id, spring.security.oauth2.client.registration.kakao.client-secret์— ๋ถ™์—ฌ๋„ฃ์Œ
  • ๋‚ด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜-API ์„ค์ •์—์„œ ํ•„์š”ํ•œ ํšŒ์› ์ •๋ณด๋ฅผ ์ฒดํฌ
  • ์•„๋ž˜์˜ ๋กœ๊ทธ์ธ ์˜คํ”ˆ API ์„œ๋น„์Šค ํ™˜๊ฒฝ์— ์„œ๋น„์Šค URL ๋ฐ Callback URL์„ ์„ค์ •

c) ์นด์นด์˜ค

  • https://developers.kakao.com/product/kakaoLogin
  • ๋กœ๊ทธ์ธ ํ›„ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ถ”๊ฐ€
  • ์•ฑ ์„ค์ •-์•ฑ ํ‚ค-REST APIํ‚ค๋ฅผ application-secure.properties์˜ spring.security.oauth2.client.registration.kakao.client-id์— ์ถ”๊ฐ€
  • ์ œํ’ˆ ์„ค์ •-์นด์นด์˜ค ๋กœ๊ทธ์ธ-๋ณด์•ˆ-Client Secret-์ฝ”๋“œ๋ฅผ spring.security.oauth2.client.registration.kakao.client-secret์— ์ถ”๊ฐ€
  • ์ œํ’ˆ ์„ค์ •-์นด์นด์˜ค ๋กœ๊ทธ์ธ-๋™์˜ ํ•ญ๋ชฉ์—์„œ ํ•„์š”ํ•œ ์ •๋ณด๋“ค์„ ์ฒดํฌ
  • ์ œํ’ˆ ์„ค์ •-์นด์นด์˜ค ๋กœ๊ทธ์ธ์—์„œ Redirect URI๋ฅผ ์ง€์ •

About

๐Ÿถ๋ฐ˜๋ ค ๋™๋ฌผ ์ˆ˜์ œ ๊ฐ„์‹ ๋ ˆ์‹œํ”ผ ์ œ๊ณต ์„œ๋น„์Šค

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published