I have a server and want to deploy my Yesod applications without installing GHC and Cabal. I am not sure if is possible: a Teacher told me that I must first compile Keter in my machine and, after that, put keter
executable on the server, though I am not sure how to do that.
To build Keter, first you'll need to clone the sources from its GitHub repository. Then you'll need to set up a Haskell build environment and use
cabal build
orcabal install
to build the sources. Personally, I use a Docker container derived from an image based on the followingDockerfile
:This is an image containing the Keter sources checked out at a specific revision with the minimum GHC toolchain required to build it all. The
cabal
command lines pull down all the project's dependencies and compiles the whole thing. Once this has completed, you can grab theketer
executable from~/.cabal/bin/keter
.Even if you choose not to use Docker, this file should give you a rough idea how to set up your environment.
Now you have Keter compiled, you can run it inside another Docker container. Here's a rough idea what the
Dockerfile
for the corresponding image might look like:Ths will take a base Debian image and install a minimal set of packages on top of it. It then copies the
keter
executable and configuration file into the image. If you then run a container from the resulting image it will start theketer
executable.Fair warning: This whole process is fairly involved. I'm still working on tweaking the exact details myself. Good luck!