๋ชฉ๋กTotal (68)

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 ๋ฐฐํฌ์ž๋™ํ™” ๊ตฌ์ถ• _ 5. ECS ๋ฐฐํฌ ์ž๋™ํ™” ํ…Œ์ŠคํŠธ

์•ž์„œ ๊ตฌ์ถ•ํ•œ ECS์—์„œ ์ƒˆ๋กœ์šด ์ด๋ฏธ์ง€๊ฐ€ ์ž๋™์ ์œผ๋กœ ๋ฐฐํฌ๋˜๋Š” ๊ณผ์ •์„ ์ถ”๊ฐ€ํ•ด์ฃผ๋ ค๊ณ  ํ•œ๋‹ค. ์ด๋ฏธ์ง€๊ฐ€ ์ƒˆ๋กญ๊ฒŒ ์ƒ์„ฑ๋˜์–ด์„œ ECR๋กœ pushํ•˜๊ณ , ์ƒˆ๋กœ์šด ์ด๋ฏธ์ง€ tag๋ฅผ ์ง€์ •ํ•˜์—ฌ ์—…๋กœ๋“œ ํ•˜๋Š” ๊ฒƒ ๊นŒ์ง„ ์™„๋ฃŒํ–ˆ์—ˆ๋‹ค. ๊ทผ๋ฐ ์ด ์ด๋ฏธ์ง€ ํƒœ๊ทธ๋ฅผ ECS์˜ Task Definition์— ์—…๋ฐ์ดํŠธํ•ด์•ผ ECS๊ฐ€ ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ ๊ฐ์ง€ํ•˜์—ฌ EC2๋กœ ๋ฐฐํฌ ๋ช…๋ น์„ ๋‚ด๋ฆฌ๊ฒŒ ๋œ๋‹ค. ์˜ค๋Š˜์€ ์ด Task Definition์— ์ƒˆ๋กœ์šด ์ด๋ฏธ์ง€ ํƒœ๊ทธ๋ฅผ ์—…๋ฐ์ดํŠธํ•˜์—ฌ ๋ฐฐํฌํ•˜๋Š” ๊ณผ์ •์„ ํ…Œ์ŠคํŠธ ํ•ด๋ณผ ๊ฒƒ์ด๋‹ค. ์ด์ „์— ์ž‘์„ฑํ–ˆ์—ˆ๋˜ deployment.yml ํŒŒ์ผ์„ ์ˆ˜์ •ํ•ด๋ณด์ž. 1. ECS ์ฝ˜์†”์—์„œ ์•„๋ž˜์— ํ•ด๋‹นํ•˜๋Š” ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ์ฐพ์•„ ์ถ”๊ฐ€ํ•ด์ค€๋‹ค. env: ENV: development AWS_REGION: ap-northeast-2 CONTAINER_NAME: conta..