๋ชฉ๋กInfra (8)

suvera-dev ๐Ÿฅฆ

AWS ) ์ •์  ์›น ์‚ฌ์ดํŠธ ๋ฐฐํฌ ๋ฐฉ์‹ ๋น„๊ต ( nginx / cloudFront / amplify )

์•ž์„œ AWS ๋ฐฐํฌ ๊ณผ์ •์„ ํฌ์ŠคํŒ…ํ•˜๋ฉด์„œ EC2 + WebServer๋ฅผ ํ™œ์šฉํ•˜์—ฌ ์‹ค์Šต์„ ํ•ด๋ณด์•˜๋Š”๋ฐ์š”. ๊ทธ ์™ธ์—๋„ ์›น์‚ฌ์ดํŠธ๋ฅผ ๋ฐฐํฌํ•˜๋Š” ๋ฐฉ๋ฒ•์—๋Š” ์—ฌ๋Ÿฌ๊ฐ€์ง€ ๋ฐฉ๋ฒ•๋“ค์ด ์žˆ์–ด์„œ ํ•œ๋ฒˆ ๋น„๊ตํ•ด๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. 1. AWS - EC2 + WebServer(Nginx) ๋ฅผ ํ™œ์šฉํ•œ ๋ฐฐํฌ 2. AWS - CloudFront + S3๋ฅผ ํ™œ์šฉํ•œ ๋ฐฐํฌ 3. AWS - Amplify๋ฅผ ํ™œ์šฉํ•œ ๋ฐฐํฌ 1. EC2 + WebServer ( Nginx ) ๋ฅผ ํ™œ์šฉํ•œ ๋ฐฐํฌ - AWS EC2 ์ธ์Šคํ„ด์Šค ์œ„์— Nginx ์›น์„œ๋ฒ„๋ฅผ ์ด์šฉํ•˜์—ฌ ์„œ๋ฒ„ ํ˜ธ์ŠคํŒ…์„ ์ง„ํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•. EC2๋Š” ํ•˜๋‚˜์˜ ์ž‘์€ ๊ฐ€์ƒ์˜ ์„œ๋ฒ„์ด๊ณ , Nginx๋Š” OS์œ„์— ์›น ์„œ๋น„์Šค๋ฅผ ๋„์šฐ๊ธฐ ์œ„ํ•œ ์›น ์„œ๋ฒ„. EC2์™€ Nginx๋ฅผ ์ด์šฉํ•ด์„œ ๊ฐ„๋‹จํ•˜๊ฒŒ ์ •์ ์ธ ์‚ฌ์ดํŠธ๋ฅผ ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ๋‹ค. ์žฅ์  1) Ngi..

Infra/AWS 2023. 7. 15. 15:45
AWS ๋ฐฐํฌ์ž๋™ํ™” ๊ตฌ์ถ• _ 6. React ํ”„๋กœ์ ํŠธ ๋ฐฐํฌ

์ด์ „์— index.html ํŒŒ์ผํ•˜๋‚˜๋กœ ๋ฐฐํฌ ํ…Œ์ŠคํŠธ๋ฅผ ํ–ˆ์—ˆ๋Š”๋ฐ, ์‹ค์ œ๋กœ ๋ฐฐํฌํ•ด์•ผํ•˜๋Š” ํ”„๋กœ์ ํŠธ๋Š” React ํ”„๋กœ์ ํŠธ๋กœ ๊ตฌ์„ฑํ•  ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์— React ํ”„๋กœ์ ํŠธ๋ฅผ ๋งŒ๋“ค๊ณ  ์ž˜ ๋œจ๋Š”์ง€ ํ™•์ธํ•ด๋ณด์ž. 1. React ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ - ๋ฆฌ์•กํŠธ ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๊ฐ„๋‹จํ•˜๋‹ค. - ์ด์ „์— ์ง„ํ–‰ํ–ˆ๋˜ ํด๋”์—์„œ ๊ทธ๋Œ€๋กœ React ํ”„๋กœ์ ํŠธ๋ฅผ ๋งŒ๋“ค์–ด์ฃผ์—ˆ๋‹ค. Node.js ์„ค์น˜ ์ž‘์—…์šฉ ํด๋” ๋งŒ๋“ค๊ธฐ ํ„ฐ๋ฏธ๋„์—์„œ npx create-react-app ํ”„๋กœ์ ํŠธ๋ช… ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ์ž๋™์ ์œผ๋กœ ํ•„์š”ํ•œ ํด๋”๋“ค์ด ์„ธํŒ…๋œ๋‹ค. 2. Docker ํŒŒ์ผ ์ˆ˜์ • ์•„๋ž˜์— ๊ฐ ์ฝ”๋“œ ์„ค๋ช…์„ ์ ์–ด๋‘์—ˆ๋‹ค. # base image ์„ค์ •(as build ๋กœ ์™„๋ฃŒ๋œ ํŒŒ์ผ์„ ๋ฐ‘์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.) FROM node:14-alpine as build # ์ปจํ…Œ์ด๋„ˆ ๋‚ด๋ถ€ ์ž‘..

Infra/CI CD 2023. 7. 14. 14:39
AWS ๋ฐฐํฌ์ž๋™ํ™” ๊ตฌ์ถ• _ 4. ECS ์ƒ์„ฑ ๋ฐ ELB ์—ฐ๊ฒฐ / ECR image ๋ฐฐํฌ

์ด๋ฒˆ ํ”„๋กœ์„ธ์Šค๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. - ECS ์ƒ์„ฑ : Cluster, Service, Task Definition - ELB ์ƒ์„ฑ , ์—ฐ๊ฒฐ - EC2 ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ : Auto Scaling Group ์‹œ์ž‘ํ•˜๊ธฐ ์ „์— ๊ฐ„๋‹จํžˆ ๊ฐœ๋…์„ ์ •๋ฆฌํ•˜๊ณ  ๋„˜์–ด๊ฐ€์ž. 1. EC2 : ๊ฐ€์ƒ ์„œ๋ฒ„์ธ EC2 ์ธ์Šคํ„ด์Šค๋ฅผ ํ”„๋กœ๋น„์ €๋‹ํ•˜๊ณ  ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. EC2 ์ธ์Šคํ„ด์Šค๋Š” ๊ฐ€์ƒ ์ปดํ“จํ„ฐ๋กœ, ๋‹ค์–‘ํ•œ ์šด์˜ ์ฒด์ œ์™€ ์†Œํ”„ํŠธ์›จ์–ด๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. EC2 ์ธ์Šคํ„ด์Šค๋Š” ๊ฐ€์ƒ ํ”„๋ผ์ด๋น— ํด๋ผ์šฐ๋“œ(VPC) ๋‚ด์—์„œ ์‹คํ–‰๋˜๋ฉฐ, ์ธํ„ฐ๋„ท์„ ํ†ตํ•ด ์•ก์„ธ์Šคํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. 2. Auto Scaling Group : ์˜คํ† ์Šค์ผ€์ผ๋ง ๊ทธ๋ฃน์€ EC2 ์ธ์Šคํ„ด์Šค์˜ ๊ทธ๋ฃน์ž…๋‹ˆ๋‹ค. ์ด ๊ทธ๋ฃน์€ ์‚ฌ์šฉ์ž๊ฐ€ ์ •์˜ํ•œ ์กฐ๊ฑด์— ๋”ฐ๋ผ EC2 ์ธ์Šคํ„ด์Šค๋ฅผ ์ž๋™์œผ๋กœ ํ”„๋กœ๋น„์ €๋‹ํ•˜๊ณ  ์กฐ์ •ํ•˜์—ฌ ์• ํ”Œ๋ฆฌ์ผ€..

Infra/CI CD 2023. 7. 14. 01:15