Skip to content

Latest commit

ย 

History

History
93 lines (71 loc) ยท 2.45 KB

File metadata and controls

93 lines (71 loc) ยท 2.45 KB

๐Ÿš€ Bitcoin Center Seoul ๋ฐฐํฌ ๊ฐ€์ด๋“œ

๐Ÿ“‹ ์‚ฌ์ „ ์ค€๋น„

1. deploy.sh ์„ค์ •

deploy.sh ํŒŒ์ผ์—์„œ ๋‹ค์Œ ๊ฐ’๋“ค์„ ์‹ค์ œ ๊ฐ’์œผ๋กœ ๋ณ€๊ฒฝํ•ด์ฃผ์„ธ์š”:

# ์„ค์ • (์‹ค์ œ ๊ฐ’์œผ๋กœ ๋ณ€๊ฒฝํ•ด์ฃผ์„ธ์š”)
EC2_IP="3.34.123.45"  # ์‹ค์ œ EC2 ํผ๋ธ”๋ฆญ IP
GITHUB_REPO="https://github.com/yourusername/bitcoin-center-seoul.git"  # ์‹ค์ œ GitHub ์ €์žฅ์†Œ URL
KEY_PATH="~/.ssh/bitcoin-center-seoul-key"  # SSH ํ‚ค ๊ฒฝ๋กœ

2. SSH ํ‚ค ํ™•์ธ

# SSH ํ‚ค๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธ
ls -la ~/.ssh/bitcoin-center-seoul-key

# ์—†๋‹ค๋ฉด ์ƒ์„ฑ
ssh-keygen -t rsa -b 4096 -f ~/.ssh/bitcoin-center-seoul-key

๐ŸŽฏ ์‚ฌ์šฉ๋ฒ•

์†Œ์Šค์ฝ”๋“œ ์—…๋ฐ์ดํŠธ ํ›„ ๋ฐฐํฌ

# 1. ์†Œ์Šค์ฝ”๋“œ ์ˆ˜์ • ํ›„ GitHub์— push
git add .
git commit -m "์—…๋ฐ์ดํŠธ ๋‚ด์šฉ"
git push origin main

# 2. ๋ฐฐํฌ ์‹คํ–‰
./deploy.sh

๋ฐฐํฌ ๊ณผ์ •

  1. โœ… ์„ค์ • ํ™•์ธ - EC2 IP์™€ GitHub URL ๊ฒ€์ฆ
  2. โœ… EC2 ์—ฐ๊ฒฐ ํ…Œ์ŠคํŠธ - SSH ์—ฐ๊ฒฐ ํ™•์ธ
  3. โœ… GitHub์—์„œ ์ตœ์‹  ์ฝ”๋“œ pull - main ๋ธŒ๋žœ์น˜์—์„œ ์ตœ์‹  ์ฝ”๋“œ ๊ฐ€์ ธ์˜ค๊ธฐ
  4. โœ… ์˜์กด์„ฑ ์„ค์น˜ - npm install
  5. โœ… ํ”„๋กœ๋•์…˜ ๋นŒ๋“œ - npm run build
  6. โœ… ์„œ๋น„์Šค ์žฌ์‹œ์ž‘ - PM2๋กœ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์žฌ์‹œ์ž‘
  7. โœ… ์ƒํƒœ ํ™•์ธ - ์„œ๋น„์Šค ๋ฐ ์›น์‚ฌ์ดํŠธ ์ ‘์† ํ…Œ์ŠคํŠธ

๐Ÿ”ง ๋ฌธ์ œ ํ•ด๊ฒฐ

EC2 ์—ฐ๊ฒฐ ์‹คํŒจ

# SSH ํ‚ค ๊ถŒํ•œ ํ™•์ธ
chmod 600 ~/.ssh/bitcoin-center-seoul-key

# EC2 ๋ณด์•ˆ ๊ทธ๋ฃน์—์„œ ํฌํŠธ 22 ์—ด๋ ค์žˆ๋Š”์ง€ ํ™•์ธ

๋นŒ๋“œ ์‹คํŒจ

# EC2์—์„œ ์ง์ ‘ ํ™•์ธ
ssh -i ~/.ssh/bitcoin-center-seoul-key ubuntu@YOUR_EC2_IP
cd /var/www/bitcoin-center-seoul
npm run build

์„œ๋น„์Šค ์žฌ์‹œ์ž‘ ์‹คํŒจ

# PM2 ์ƒํƒœ ํ™•์ธ
ssh -i ~/.ssh/bitcoin-center-seoul-key ubuntu@YOUR_EC2_IP 'pm2 status'

# PM2 ๋กœ๊ทธ ํ™•์ธ
ssh -i ~/.ssh/bitcoin-center-seoul-key ubuntu@YOUR_EC2_IP 'pm2 logs bitcoin-center-seoul'

๐Ÿ“Š ์œ ์šฉํ•œ ๋ช…๋ น์–ด

# ์„œ๋น„์Šค ์ƒํƒœ ํ™•์ธ
ssh -i ~/.ssh/bitcoin-center-seoul-key ubuntu@YOUR_EC2_IP 'pm2 status'

# ๋กœ๊ทธ ์‹ค์‹œ๊ฐ„ ํ™•์ธ
ssh -i ~/.ssh/bitcoin-center-seoul-key ubuntu@YOUR_EC2_IP 'pm2 logs bitcoin-center-seoul --follow'

# Nginx ์žฌ์‹œ์ž‘
ssh -i ~/.ssh/bitcoin-center-seoul-key ubuntu@YOUR_EC2_IP 'sudo systemctl restart nginx'

# ์›น์‚ฌ์ดํŠธ ์ ‘์† ํ…Œ์ŠคํŠธ
curl -I https://bitcoincenterseoul.com

๐ŸŒ ์ ‘์† URL