Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Go Web ApplicationをHerokuにデプロイ #herokujp
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
Transcript
20 slides
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
More Decks by taichi nakashima
See All by taichi nakashima
Platform Engineering at Mercari (Platform Engineering Kaigi 2024)
tcnksm
6
5.9k
Platform Engineering at Mercari
tcnksm
8
6.1k
Embedded SRE at Mercari
tcnksm
0
1.6k
How We Harden Platform Security at Mercari
tcnksm
2
2k
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.8k
Other Decks in Technology
See All in Technology
コピーオンライト型ファイルシステムと ランダム書き込み
sat
PRO
2
130
RAGの改善を速く回すための評価基盤
yosukeyoshida
6
3.4k
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
17
120k
文書画像からの情報抽出を行うエージェントを、軌跡の正解データ無しで作れるか
sansantech
PRO
2
220
Del vibe coding a un Desarrollo (agéntico) fiable
jcabot
0
190
アラートを見直していたら営業組織への理解にちょっとだけ繋がった話
z63d
1
210
AWS Blocksで AIエージェント作れるの知ってます?
kmiya84377
1
120
Linuxネットワークスタック進化の軌跡: 過去10年の歩みと最新トレンド
orimanabu
4
770
異夢同船〜異なる夢でも同じ船でなんとかする〜
fortegp05
1
560
共通基盤の実装に Kotlin - Quarkus を選定した理由と採用したアーキテクチャ
nealle
1
150
AI対話型分析を作成し、リリースするまでの話 / The Road to Release: Buiding AI Conversational Analytics
yappli_developers
0
170
WasmをRustにする技術
sansantech
PRO
1
130
Featured
See All Featured
Designing for Timeless Needs
cassininazir
1
570
Discover your Explorer Soul
emna__ayadi
2
1.3k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
770
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
HDC tutorial
michielstock
2
1k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
680
Odyssey Design
rkendrick25
PRO
3
960
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k