Spunk Autos

Websites and web tools

Running Docker for under $50: tips for small budgets

Containers do not need a big cloud bill. This page shows how a small automotive business, such as a shop with a booking app or a detailer with a gallery site, can run Docker on one modest machine and keep the monthly spend under a fixed cap of $50.

Start with the budget, not the tools

Write down every line that will cost money each month before you install anything. Typical lines are the server or virtual machine, storage for backups, the domain name (often billed yearly, so divide by 12), and any paid container registry. Prices change often and vary by provider, so check the provider's own pricing page and add a margin of about a fifth for surprises such as extra bandwidth.

A budget worksheet to fill in with your own quotes
Line itemBillingHow to convert to monthly
Virtual serverMonthly or hourlyHourly rate x 730 hours
Backup storagePer GB per monthGB stored x rate
Domain nameYearlyYearly price / 12
Registry or CI minutesUsage basedLast month's usage x rate
MarginYour choiceAdd 20% of the total

Keep images small

Image size affects disk space, pull time and how many packages you must patch. Three habits do most of the work:

  • Use a slim or minimal base image for the language you run, and pin it to a version tag rather than latest.
  • Use a multi-stage build: compile in a full image, then copy only the output into a small runtime image.
  • Add a .dockerignore file so node_modules, .git, test photos and local env files never enter the build context.

One server, one Compose file

A small business site rarely needs an orchestrator. A single virtual machine running Docker Compose can host the web app, a database and a reverse proxy that handles HTTPS. Keep the whole stack in one compose.yaml under version control so you can rebuild the server from scratch.

  1. Create a non-root user on the server and add it to the docker group only if you accept that this group is root-equivalent.
  2. Set restart: unless-stopped on each service so containers come back after a reboot.
  3. Set memory limits per service so one runaway process cannot starve the database.
  4. Put database files on a named volume, never inside the container's writable layer.
  5. Run docker system prune on a schedule, with care, to clear old images and build cache.

Costs that sneak up

Unbounded logs

The default json-file logging driver can grow without limit. Set max-size and max-file options so container logs rotate instead of filling the disk.

Old images and volumes

Each deploy can leave the previous image behind. Over a few months this can fill a small disk and force you to buy a bigger plan. Check usage with docker system df once a month.

Backups you never test

A database dump copied to cheap object storage is inexpensive. Losing the customer booking table is not. Restore a backup to a scratch container at least once a quarter to prove it works.

When to spend more

Move beyond the cap when the server's CPU or memory sits near its limit during normal hours, when you need a second machine for uptime, or when a staff member spends more time patching than the extra spend would cost. Until then, a lean image and one well-kept server go a long way.