Heroku란?
Heroku is a cloud platform as a service supporting several programming languages. One of the first cloud platforms, Heroku has been in development since June 2007, when it supported only the Ruby programming language, but now supports Java, Node.js, Scala, Clojure, Python, PHP, and Go.
헤로쿠는 여러 프로그래밍 언어를 지원하는 서비스형 클라우드 플랫폼이다. 최초의 클라우드 플랫폼 중 하나인 헤로쿠는 루비 프로그래밍 언어만을 지원했던 2007년 6월부터 개발 중에 있으며 현재는 자바, Node.js, 스칼라, 클로저, 파이썬, PHP, Go를 지원한다.
Heroku 배포전에 Fastapi폴더에서 할일
1. Procfile을 만들어준다 (헤로쿠에 서버를 어떻게 실행시키는지 알려주는 파일) 우리가 로컬에서 실행할때 터미널에 치던 그것
web: uvicorn main:app --host=0.0.0.0 --port=${PORT:-5000}
2. requirements.txt를 만들어준다 정확하지 않으면 에러남 freeze 추천
pip3 freeze > requirements.txt
Heroku 배포
1 . heroku 가입
2. Create New app 으로 배포 할 앱을 만들어준다
3. App name 및 region을 지정 (region은 US로 지정해야 무료라고 한다?)
4. Heroku Cli 를 설치한다
5. 터미널에서 heroku login 으로 로그인
6. 내 폴더와 깃을 연결한다
cd my-project/
git init
heroku git:remote -a <app>
7. 헤로쿠에 푸시
git add .
git commit -am "first commit"
git push heroku master
8. Release V3 가 나오면 잘되는지 확인하자
'Fastapi' 카테고리의 다른 글
| fast api 설치하기 (0) | 2021.12.21 |
|---|