Heroku 이용하기

<Heroku>

헤로쿠란?

  • 무료로 웹 호스팅을 제공하는 서비스
  • 무료 버전의 경우, 최대 5개의 어플리케이션을 올릴 수 있고 30분 동안 이용을 하지 않을 시, sleep상태로 빠져 다시 웹이 깨어나는 데 시간이 걸린다.
  • 발표용, 포토폴리오용으로 GOOD!

 

[설치 방법]

 

 

 

Heroku

 

dashboard.heroku.com

 

 

The Heroku CLI | Heroku Dev Center

The Heroku CLI Last updated 15 June 2020 The Heroku Command Line Interface (CLI) makes it easy to create and manage your Heroku apps directly from the terminal. It’s an essential part of using Heroku. Download and install The Heroku CLI requires Git, the

devcenter.heroku.com

 

 

  • 설치 확인 : terminal에서 heroku --version 명령어로 확인 & heroku login 명령어로 사이트로 넘어가서 로그인하기

 

 

 

* 열린 사이트에서 log in 클릭

 

 

 

  • 터미널에서 heroku plugins:install java 입력

 

[ 서비스 배포 방법 ]

 

 

 

  • Heroku에 올릴 프로젝트 생성 ( 나의 경우 :  dynamic web project > maven project로 변경했음 + index.jsp 생성 )
  • Heroku 사이트에서 새로운 앱 생성

 

 

 

 

  • 만든 프로젝트 heroku에 올리기 :  

 

1. 터미널 접속

 

2. 프로젝트 폴더 안에서 mvn package

 

 

* 앞의 단계가 완료되면, 프로젝트 폴더 내 target 폴더로 이동하면 .war 파일 확인 가능

 

 

3. 이동한 target 폴더에서 heroku war:deploy 프로젝트명-0.0.1-SNAPSHOT.war --app 앱이름

 

 

 

 

* Heroku 사이트에서 웹 페이지 열기