Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Go Web ApplicationをHerokuにデプロイ #herokujp
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
taichi nakashima
May 22, 2014
Technology
3.9k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Go Web ApplicationをHerokuにデプロイ #herokujp
http://herokujp.doorkeeper.jp/events/10902
taichi nakashima
May 22, 2014
More Decks by taichi nakashima
See All by taichi nakashima
Platform Engineering at Mercari (Platform Engineering Kaigi 2024)
tcnksm
6
5.6k
Platform Engineering at Mercari
tcnksm
8
5.9k
Embedded SRE at Mercari
tcnksm
0
1.6k
How We Harden Platform Security at Mercari
tcnksm
2
1.9k
SRE Practices in Mercari Microservices
tcnksm
11
15k
開発者向けの基盤をつくる
tcnksm
38
12k
How We Structure Our Work At Mercari Microservices Platform Team
tcnksm
11
24k
Microservices Platform on Kubernetes at Mercari
tcnksm
16
17k
Introduction to Mercari Micorservices Platform Team
tcnksm
5
3.7k
Other Decks in Technology
See All in Technology
貴方はどのエンジニアリングを磨くのか
hatyibei
0
100
AIと共生する開発者プラットフォーム:バクラクのモノレポ×マイクロサービス基盤
sakajunquality
2
2.9k
Mastraエージェント、どのクラウドにデプロイする?
minorun365
PRO
2
180
グローバルチームと挑むプロダクト開発
sansantech
PRO
1
170
アカウントが増えてからでは遅い? ~ マルチアカウント統制の勘所 ~
kenichinakamura
0
210
なぜ私たちのSREプラクティスはなかなか機能しないのか 〜システムより先に組織を見る〜 / Why our SRE practices aren't really working
vtryo
3
3.1k
型は壁、Rustでもバグを直すな、表現できなくせよ
nwiizo
12
1.9k
『AIに負けない』より『AIと遊ぶ』」〜ワクワクが最強のテスト・QA学習戦略_公開用
odan611
2
540
プライバシー保護の理論と実践
lycorptech_jp
PRO
1
250
AI時代における最適なQA組織の作り方
ymty
3
490
金融の未来を考える / Thinking About the Future of Finance
ks91
PRO
0
180
プロンプト_きのこカンファレンス2026_LT
yurufuwahealer
0
150
Featured
See All Featured
How to build a perfect <img>
jonoalderson
1
5.8k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
410
Prompt Engineering for Job Search
mfonobong
0
370
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
220
Faster Mobile Websites
deanohume
310
32k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
870
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
320
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
200
Building Flexible Design Systems
yeseniaperezcruz
330
40k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
63
55k
New Earth Scene 8
popppiees
3
2.4k
Transcript
Deploy Golang Web Application to Heroku
I’m Taichi Nakashima twitter ID is @deeeet
http://deeeet.com/writing
Marniti Λ͔ͭͬͨ Golang Web Application Λ Heroku ʹσϓϩΠ͢Δ
• GoͷܰྔWebϑϨʔϜϫʔΫ • SinatraExpressͷӨڹ • MiddlewareʹΑΔ֦ு Martini.
sinatra require 'sinatra' ! get '/' do "Hello!" end
Martini. package main ! import "github.com/go-martini/martini" ! func main() {
m := martini.Classic() m.Get("/", func() string { return "Hello!" }) m.Run() }
• ґଘύοέʔδͷཧ • Procfileͷ४උ • Buildpackͷ४උ How?
$ go get github.com/kr/godep $ godep save $ gem install
bundler $ bundle install Dependency
Procfile web: bundle exec rackup config.ru -p $PORT $ echo
"web: $(basename `pwd`)" > Procfile
Buildpack $ heroku create $ heroku create -b https://github.com/kr/ heroku-buildpack-go.git
Deploy $ git push heroku master
Heroku on Docker Build a Docker container for app using
Heroku Buildpacks
! • ContainerܕԾԽιϑτ ΣΞ • VMͱൺͯΦʔόϔου͕ গͳ͘ߴʹಈ࡞ • OSXͰܰྔVMΛ্ཱͪ͛ Ε͑Δ
• CenturyLinkLabs࡞ • BuildpackΛͬͨDocker container Λ࡞ • ϩʔΧϧʹHerokuͱಉ͡ ڥΛؾܰʹ࡞Γ͍ͨΛ࣮ݱ •
Rails, Node, Golang Building
Prepare on OSX $ brew install docker boot2docker $ boot2docker
init $ boot2docker up
Prepare $ gem install building
Run building $ cd your-application $ building -p 3000 tcnksm/goapp
Run building $ building -p 3000 tcnksm/goapp create Dockerfile building
docker build -t tcnksm/goapp:latest . Step 0 : FROM ctlc/buildstep:ubuntu13.10 ---> a5432f93c775 Step 1 : ADD . /app ---> ef908258208c Step 2 : RUN /build/builder ---> Running in afd1b5565e3c Go app detected -----> Installing go1.2.1... done -----> Running: godep go install -tags heroku ./... -----> Discovering process types Procfile declares types -> web ---> 1d4265dcac7 running docker run -d -p 3000 -e "PORT=3000" tcnksm/goapp
Conclusion • GolangͷWeb ApplicationΛHerokuʹDeploy • Heroku on Docker