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
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
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
2026年 エンジニアリング自己学習法
yumechi
0
140
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
130
ノイジーネイバー問題を解決する 公平なキューイング
occhi
0
100
SourceGeneratorのススメ
htkym
0
200
24時間止められないシステムを守る-医療ITにおけるランサムウェア対策の実際
koukimiura
1
100
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
5
740
高速開発のためのコード整理術
sutetotanuki
1
400
MUSUBIXとは
nahisaho
0
140
Patterns of Patterns
denyspoltorak
0
1.4k
Fragmented Architectures
denyspoltorak
0
160
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
470
Featured
See All Featured
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
640
Evolving SEO for Evolving Search Engines
ryanjones
0
130
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
66
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
First, design no harm
axbom
PRO
2
1.1k
Side Projects
sachag
455
43k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
110
Leo the Paperboy
mayatellez
4
1.4k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
140
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
440
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!