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
Paweł Słomka
February 21, 2019
Programming
0
37
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
56
Building Great APIs With gRPC - GoLab 2018
slomek
1
120
Documenting Go Code With Beautiful Tests - GopherCon UK 2018
slomek
0
170
Other Decks in Programming
See All in Programming
testingを眺める
matumoto
1
140
print("Hello, World")
eddie
2
530
速いWebフレームワークを作る
yusukebe
5
1.7k
1から理解するWeb Push
dora1998
7
1.9k
AIを活用し、今後に備えるための技術知識 / Basic Knowledge to Utilize AI
kishida
22
5.7k
今から始めるClaude Code入門〜AIコーディングエージェントの歴史と導入〜
nokomoro3
0
150
Amazon RDS 向けに提供されている MCP Server と仕組みを調べてみた/jawsug-okayama-2025-aurora-mcp
takahashiikki
1
110
知っているようで知らない"rails new"の世界 / The World of "rails new" You Think You Know but Don't
luccafort
PRO
1
150
Testing Trophyは叫ばない
toms74209200
0
870
AWS発のAIエディタKiroを使ってみた
iriikeita
1
190
もうちょっといいRubyプロファイラを作りたい (2025)
osyoyu
1
430
Navigating Dependency Injection with Metro
zacsweers
3
260
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Site-Speed That Sticks
csswizardry
10
810
The World Runs on Bad Software
bkeepers
PRO
70
11k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.4k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
Fireside Chat
paigeccino
39
3.6k
Building an army of robots
kneath
306
46k
Embracing the Ebb and Flow
colly
87
4.8k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.1k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Building Adaptive Systems
keathley
43
2.7k
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!