Hi all, I’ve started to play around with golang more seriously and plan to build some REST backend with a SinglePage front mostly for getting the “real feel for it”.
I tried to put up a simple prototype on an Openshift gear yesterday but noticed, of course, problems with my gorilla/mux package… I guess openshift won’t run any “go get” commands for me.
So, what is the easiest way to get something up in the cloud?
A virtual machine on Azure and put it behind IIS/nginx? Googles appengine?
Thank you, I think I have an old Koding account, better look into it.
Guess I better fix myself a dedicated golang VM somewhere in the near future, but it’s nice to have something for prototyping that’s not only local.
I’ve had a pleasant experience running Go applications on Heroku. The free tier requires your application to sleep every now and then but for testing purposes it should do fine.
I’m partial to Heroku, but GAE, AWS Elastic Beanstalk, Engine Yard and Openshift are all good options. Not sure what issues you’re running into on Openshift though: you should be able to specify build steps.
A big plus with Heroku is that you don’t need to change your app to migrate to/from as there aren’t any custom packages to worry about. I deploy from GitHub => Travis => Heroku automatically on pushes to master.
Great answers thank you all, there’s definitely a lot of options to play with.
I Guess I could get it going on openshift, I simply wrote my REST service (using gorilla/mux) and committed and pushed to my Gear… It wasn’t that easy I suppose.
I’ll think I’'ll try them all, a man can’t have enough cloud-accounts these days.
I run a couple of small Go apps on Digital Ocean using Dokku. The setup is pretty easy and is very Heroku like. I am running them on the $5 a month VM – they don’t require much memory or any disk.
With aws free tier, you need to remember to close your account or delete the instance if you’re not going to use it, because they will charge you after one year, it happened to me, but they were kind and refunded the payment.
To be fair to nginx, it’d be hard to write gzip middleware, FD caching for static assets, a full OCSP stapling implementation, etc in a safe manner. A big benefit to nginx is that’s heavily battle-tested and you configure it via a DSL, not a full blown programming language. Can be a benefit to keep web server logic out of your web service.
nginx (and Caddy, both being reverse proxies) also allow your Go application to restart in the background while they queue requests.
Oh sure! There are definitely things nginx does that are important at
scale, and that would be a lot of work to replicate by hand coding. I use
nginx. But in a lot of cases I see people use nginx as a simple reverse
proxy, even with name based virtual hosts, where a tiny go app would have
done the job.
I’m not saying “never use nginx” I’m trying to say “use the right tool for
the job.”
Actually you should be able to run it on openshift also, i would not recommend using “go get” on a environment different than you machine / development, and use a vendoring to runt it on a cloud provider, there are some good talks about it:
Yes I guess I should, better look into it a little more. I got it working on heroku though, but I prefer a proper VM under my control I guess, so I can play around with databases and whatever comes to mind.