Skip to content

Latest commit

 

History

History
152 lines (107 loc) · 2.63 KB

getting-started.md

File metadata and controls

152 lines (107 loc) · 2.63 KB

시작하기


로컬에서 시작하기

필요 환경

빌드

빌드 결과물은 ./backend/dist 폴더에 생성됩니다.

Windows (cmd)
cd tools
build.bat

테스트 서버

디버그를 위해 테스트 서버를 실행하려면, 터미널 두개가 필요합니다.

frontend

cd ./frontend
yarn install
yarn serve

backend

cd ./backend
cp .env.example .env
yarn install
yarn dev

AWS EC2 로 시작하기

설치 목록

  • Node.js (버전 12이상)
  • MongoDB
  • Nginx
  • UFW(Firewall)
  • pm2
  • yarn

설치준비

sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install curl

Node.js 설치하기

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs

MongoDB 설치하기

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
sudo apt-get install -y mongodb-org
sudo systemctl start mongod
sudo systemctl enable mongod

Nginix 설치하기

sudo apt-get install -y nginx

UFW(FIREWALL) 설치하기

sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw --force enable

Yarn 설치하기

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install -y yarn

PM2 설치하기

npm install -g pm2

Nginx 설정하기

sudo rm /etc/nginx/sites-available/default
sudo vim /etc/nginx/sites-available/default
  • 아래와 같은 내용으로 작성해줍니다.
# /etc/nginx/sites-available/default
server {
  listen 80 default_server;
  server_name _;

  # node api reverse proxy
  location / {
    proxy_pass http://127.0.0.1:5000/;
  }
}
  • nginx 서비스 재시작
sudo systemctl restart nginx

실행하기

git clone https://github.com/Tekiter/EZSET.git

cd ./EZSET/tools
sudo chmod a+x update.sh

pm2 start --name EZSET update.sh