Do you have working examples of how to do this?
I found this article, but it seems a lot more work than I currently need to do. https://circleci.com/blog/package-a-clojure-web-application-using-docker/ I wouldn't run Postgesql inside docker container, especially not for production, so that would reduce the complexity a but, but it seems I still need to deploy the container somewhere after all the setup to build it. Any suggestions on that would be helpful.
Very interesting conversations... Keep it going! 🙂 I agree that AWS is a significant complexity tax, but in exchange it enables creating an auditable infrastructure, which pays off when you would want to offer your application to be integrated into someone else's existing infrastructure, so they can host it for themselves. For that kind of situations, AWS (or GCP and Azure) is a great platform, where both small and big companies can meet. This however only makes sense, when your application has already proven itself and start to handle hundreds of user and your database is accreting upwards of hundreds of megabytes of data daily. If you don't start with AWS early, then your migration will cost more. Agility at the beginning of the lifecycle of a software project is more important than the incurred migration cost later...
This made me curious how hard is it to integrate Heroku with existing AWS solutions... maybe with the smaller, in-house projects we can target Heroku first and migrate them to AWS later. Apps on Heroku would need to access data on AWS from the get-go though... How secure, performant and costly would that be?
https://devcenter.heroku.com/search?utf8=✓&q=clojure+deps.edn yields no result 😞 but as i see heroku has some support for tools.deps project: https://www.gertgoet.com/2019/02/06/deploying-a-tools-deps-clojure-project-to-heroku.html i really don't want to go back to leiningen... 😕 i came to tools.deps from boot and it feels like going back to lein makes no sense...
@onetom Heroku uses Leiningen by default (its arguably the most used build tool for Clojure). However, you can just provide an empty project.clj file and a custom build script called
bin/build in the root of the project and Heroku will use that script. The script just calls what ever tool you want to use to generate an uberjar with Clojure CLI tools
Then just add a config var to the Heroku app to set the Clojure CLI version and everything else is the same. There is an example of using CircleCI and Heroku pipelines with Clojure CLI here https://practicalli.github.io/clojure-webapps/projects/banking-on-clojure/deployment-via-ci.html1👍
#!/usr/bin/env bash clojure -A:uberjar
Heroku runs on AWS (its one of their biggest customers). There are a lot of services you can get through Heroku, however, if you set AWS services up in the same region as the Clojure app deployed in Heroku, then you should have little issue. The biggest challenge is typically latency if you go across data center regions.1👍
i know. i've maintained briefly a similar tool, to bridge boot and lein https://github.com/onetom/boot-lein-generate i just don't want the extra overhead of lein and the seemingly declarative project.clj, which does a lot of magic thru the various plugins and the resulting behaviour is quite opaque. it also adds quite some seconds to the clojure program startup times. some of these issues have been mitigated by tools.deps and there are even more improvements are happening lately: https://insideclojure.org/2020/07/28/clj-exec/1
The other option with Heroku is to create another Clojure buildpack using dep.edn, this would simpler and be a bit more efficient in terms of resources (no Leiningen install). It's been a while, but will take a look at creating a deps.edn buildpack in the next few weeks. They are all open source, so it's pretty easy to see examples.