Fly.ioTutorial
Serve small with Fly.io and GoStatic
Summary
The post shows how to deploy a tiny static signpost site on Fly.io using GoStatic, with the aim of keeping the application’s footprint and running cost low. GoStatic is a self-contained web server that can run in a bare Docker image; the described image is 6MB, while the completed deployment reports 7.7MB. The setup uses fly init examplegostatic -p 8043, a two-line Dockerfile based on pierrezemb/gostatic, and an index.html copied to /srv/http/index.html; Fly routes ports 80 and 443 to GoStatic’s port 8043 and provides HTTPS. After deployment reaches one healthy instance, the post reduces the default micro-2x VM from 512MB RAM to micro-1x, which provides 128MB. This matches the small workload and is presented as a way to reduce running costs.
Context
The site is a static signpost page for a recently rebranded Maker organization. The deployment is intended to have a tiny footprint so it will never cost anything to deploy, avoiding the layers and size associated with conventional Docker images that include an operating system and application server.
Approach / What changed
Create a Fly.io app configured to route ports 80 and 443 to GoStatic’s default port 8043, use a two-line Dockerfile based on pierrezemb/gostatic, copy index.html into /srv/http, and deploy with flyctl deploy. After deployment, reduce the VM from the default micro-2x size to micro-1x.
Takeaways
GoStatic runs in a bare Docker image with no operating-system layer; the post describes the image as 6MB and the completed Fly deployment as 7.7MB.
Fly.io routes public ports 80 and 443 to GoStatic’s port 8043, while Fly handles HTTPS after deployment.
The default micro-2x VM can be changed to micro-1x, reducing memory from 512MB to 128MB for this small static workload.
Source and freshness
- Source
- fly.io
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.