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
Deploying Go to Heroku
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Paweł Słomka
February 21, 2019
Programming
0
38
Deploying Go to Heroku
Paweł Słomka
February 21, 2019
Tweet
Share
More Decks by Paweł Słomka
See All by Paweł Słomka
Introduction to WASM using Go 1.11
slomek
0
58
Building Great APIs With gRPC - GoLab 2018
slomek
1
130
Documenting Go Code With Beautiful Tests - GopherCon UK 2018
slomek
0
170
Other Decks in Programming
See All in Programming
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
620
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
5
740
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
130
AI & Enginnering
codelynx
0
110
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
200
ぼくの開発環境2026
yuzneri
0
240
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
140
ノイジーネイバー問題を解決する 公平なキューイング
occhi
0
100
Best-Practices-for-Cortex-Analyst-and-AI-Agent
ryotaroikeda
1
110
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
380
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1k
Featured
See All Featured
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
170
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
Producing Creativity
orderedlist
PRO
348
40k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
How to make the Groovebox
asonas
2
1.9k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
76
30 Presentation Tips
portentint
PRO
1
220
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
Into the Great Unknown - MozCon
thekraken
40
2.3k
Odyssey Design
rkendrick25
PRO
1
500
Transcript
@pawel_slomka Deploying Go to Heroku Paweł Słomka
@pawel_slomka @pawel_slomka ABOUT ME • Blogger at mycodesmells.com • Go
developer at Ingrid • Co-organizer of GoWroc meetup • Runner ! • Millenial @pawel_slomka
@pawel_slomka WHY • You have some cool code developed locally
• You want to share that code with the world
@pawel_slomka WHERE • There a few options to choose from
(Google App Engine, AWS, Azure, etc.) • Heroku is cool as well • Multiple languages support • Docker support • Free tier (with limitations, but enough for development)
@pawel_slomka HOW I have the following code: package main import
“fmt” import “net/http” func main() { http.HandleFunc(“/“, func(rw http.ResponseWriter, _ *http.Request) { fmt.Fprint(rw, “Hello GoWroc!”) } http.ListenAndServe(“:8080”, nil) }
@pawel_slomka HOW Minor tweak for Heroku support: package main …
import “os” func main() { … http.ListenAndServe(“:”+os.Getenv(“PORT”), nil) }
@pawel_slomka HOW Add config file (heroku.yml) build: docker: web: Dockerfile
@pawel_slomka HOW Add Dockerfile FROM golang:stretch as build COPY .
/src WORKDIR /src RUN go build -o /app . ### FROM heroku/heroku:18 COPY --from=build /app /app CMD ["/app"]
@pawel_slomka DEPLOY Creating an app at Heroku heroku create my-app
heroku container:push -a my-app web Publishing image in Heroku registry: heroku container:release -a my-app web Publishing image in Heroku registry:
@pawel_slomka IT WORKS $ curl https://my-app.herokuapp.com Hello GoWroc!
@pawel_slomka SUMMARY • Little effort • Little time • Huge
satisfaction • Your code is in the cloud!
@pawel_slomka THANK YOU!