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
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.7k
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
FORENSIA: ローカルLLMフォレンジックハーネス
sumeshi
2
390
第3回しろおびセキュリティスポンサーセッション
log0417
0
200
【CEDEC2026】Creative Approaches to Localizing the Dialects and Unique Speech of Umamusume: Pretty Derby Characters in English
cygames
PRO
3
23k
モダンフロントエンド 開発研修
recruitengineers
PRO
4
650
ボトムアップ文化が強い組織で セキュリティをどう根付かせていくかの現在進行形の話 / Making Security Stick in a Bottom-Up Organization
yamaguchitk333
0
220
【CEDEC2026】『ウマ娘 プリティーダービー』 英語版のキャラクターの方言や口調をローカライズするための創造的アプローチ
cygames
PRO
2
980
Forza Horizon 6 のテレメトリ機能で 自動運転に使えそうな学習データを集める話
henjin0
0
180
Agent 時代の Kaggle 展望 / kaggle-in-the-agentic-era
upura
1
750
侵入は突然に 〜 IoTマルウェアと悪用される家庭の機器 ~ / When Intrusion Strikes: IoT Malware and the Abuse of Home Devices
nttcom
0
5.8k
認知負荷をGemini で溶かす — GKE 基盤「Orbit」における AI エージェントの実践
sansantech
PRO
1
300
『三匹の子ぶた』から学ぶネットワークセキュリティの昔と今 / Network Security: Then and Now Through the Lens of The Three Little Pigs
nttcom
1
6k
私がブラウザを自作したくなった理由
supurazako
1
240
Featured
See All Featured
Code Review Best Practice
trishagee
74
20k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
240
Test your architecture with Archunit
thirion
1
2.3k
Amusing Abliteration
ianozsvald
1
250
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Prompt Engineering for Job Search
mfonobong
0
400
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3k
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
340
The Curse of the Amulet
leimatthew05
2
14k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
2
3.8k
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