3 ms·
Not sure if it meets all of your requirements, but what about using Crystal HTTP::Server[1] and building a fully statically linked[2] binary and deploying via a
by adrianlv512 3y ago
Not sure if it meets all of your requirements, but what about using Crystal HTTP::Server[1] and building a fully statically linked[2] binary and deploying via a Docker scratch image[3] using a Multi-stage build[4].
Here's[5] an example I put together that I have running on fly.io[6]. I'm doing a redirect for root path, but it could easily be changed to serve up the contents of index.html.
I use a similar deployment for a small site I created[7] to generate UUIDs. Kemal[8] also looks like a good alternative.
----
Update:
Here's[9] an example also running on fly.io[10] using Kemal[8]
[1] https://crystal-lang.org/api/1.11.2/HTTP/Server.html https://crystal-lang.org/api/1.11.2/HTTP/Server.html
[2] https://crystal-lang.org/reference/1.11/guides/static_linking.html#fully-static-linking https://crystal-lang.org/reference/1.11/guides/static_linkin...
[3] https://docs.docker.com/build/building/multi-stage/ https://docs.docker.com/build/building/multi-stage/
[4] https://hub.docker.com/_/scratch/ https://hub.docker.com/_/scratch/
[5] https://github.com/adrianlv512/minimal-server https://github.com/adrianlv512/minimal-server
[6] https://minimal-server.fly.dev https://minimal-server.fly.dev
[7] https://uuid-generator.org/ https://uuid-generator.org/
[8] https://kemalcr.com/ https://kemalcr.com/
[9] https://github.com/adrianlv512/minimal-server-kemal https://github.com/adrianlv512/minimal-server-kemal
[10] https://minimal-server-kemal.fly.dev https://minimal-server-kemal.fly.dev
- dns_snek 3y agoI don't think anyone looking to just serve static files wants to touch a programming language, deal with any (additional) build steps, or run Docker. Especially the parent who expressed "minimal" as a requirement.
- adrianlv512 3y agoNot sure this is true regarding Docker, e.g.: https://github.com/radiosilence/nano-web?tab=readme-ov-file#docker-quick-start https://github.com/radiosilence/nano-web?tab=readme-ov-file#... https://github.com/lipanski/docker-static-website https://github.com/lipanski/docker-static-website https://github.com/PierreZ/goStatic https://github.com/PierreZ/goStatic