Steve Greene's Blog


Deploying Go Revel Web Apps on OpenShift


November 07, 2017

Recently, I wrote a web app in Golang using the Revel framework that automatically creates vote ballots for CSH through the GitHub API. After learning Flask, I felt that branching out into a new web frameworks couldn’t hurt. Turns out, the only difficult part of working with Revel was trying to deploy my code on OpenShift.

OpenShift uses the Source-to-Image (s2i) framework to create runtime containers for individual applications. At the moment, the Go s2i docker image does not support Revel projects as this docker image compiles source code with the base Go compiler. Revel projects need to be compiled with the Revel executable to ensure that all assets are properly linked. Once a Revel project is compiled, the webserver can be started by running therun.shscript in the Revel build directory.

Image

I decided to fork the s2i-go docker image repo to create a Revel specific s2i image. This was my first time ever looking at docker image source code, so modifying the image’s build script took some time. Now, I have a working s2i-revel container that reliably deploys Revel projects.


Theme originally by mattgraham, forked by me. Site Repo Contact me: [email protected]