Skip to content

keilambda/docker-haskell-cabal

Repository files navigation

An example Docker setup for Haskell (Cabal)

Note

I assume needed programs (docker, kubernetes) are installed and configured properly (ingress). For local setup of Kubernetes one can use minikube or microk8s

Docker:

# Build an image and run it:
docker build -t abc .
docker run -e PORT=8080 -it abc

# Or pass the PORT argument in build-time:
docker build --build-arg=PORT=8080 -t abc .
docker run -it abc

Docker with Kubernetes

1. Build a docker image

docker build -t abc .

2. Deploy

kubectl apply -f deployment.yaml -f service.yaml

3. Expose the app to the world

  1. Set appropriate parameters in:

    1. ingress.yaml: set host to appropriate domain through which the service will be exposed to the world.
  2. Apply:

kubectl apply -f ingress.yaml

About

An example Haskell (Cabal) server packaged into multi-stage Docker

Resources

License

Stars

Watchers

Forks