Skip to content

Commit

Permalink
Merge branch 'main' into deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
lfborjas authored Jan 24, 2021
2 parents 2dc4a3e + 2772f76 commit 8001de8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# geocode-city-api

![build](https://github.com/geocode-city/api/workflows/Haskell%20CI/badge.svg)


## Deployment

I personally use the [Heroku Container Registry](https://devcenter.heroku.com/articles/container-registry-and-runtime); but instead of using [their base images](https://devcenter.heroku.com/articles/heroku-20-stack#heroku-20-docker-image) (which are rather large,)
you'll see in the `Dockerfile` that I stubbornly use `haskell` base images to build dependencies,
and `debian:buster` for the final image -- which requires installing Postgres libraries at every step, and a very questionable `curl -k...`. I did however take some inspiration from the heroku [image Dockerfiles](https://github.com/heroku/stack-images/blob/main/heroku-20/setup.sh)

On a solidly average machine (8GB ram, 3 allocated to Docker,) a build takes ~30 mins from scratch, but under a minute if all dependencies have already been built and we're just recompiling the executables. I try to keep dependencies small, but there's at least two heavy hitters: `lens` and `swagger2`: Docker with only 2GB was running out of memory trying to compile these behemoths, even
On a solidly average machine (8GB ram, 3 allocated to Docker,) a build takes ~30 mins from scratch, but under a minute if all dependencies have already been built and we're just recompiling the executables from Haskell source code. I try to keep dependencies small, but there's at least two heavy hitters: `lens` and `swagger2`: Docker with only 2GB was running out of memory trying to compile these behemoths, even
with the `-j1` flag sent to Stack!

For my setup, these commands do the trick:
Expand Down

0 comments on commit 8001de8

Please sign in to comment.