Report this

What is the reason for this report?

Droplet: Docker => laravel (mysql) + astro app [unusable]

Posted on December 29, 2025

I have been developing a Laravel (mysql) + astro frontend application using docker to manage the services locally. Now that I am at the point where I want to test a production setup, I went with a Digital Ocean Droplet and the cheapest $4 configuration. When testing the startup of the docker container for the first time, I see the CPU usage climb to 100% and the droplet eventually becomes unreachable for hours.

So I went back to the drawing board with my docker configuration and tried to ensure that it was more tailored for production, and I also tried another configuration, this time with an intel vcpu and 2GB of RAM. Still, I am seeing the machine climb to 100% CPU usage and the droplet becoming unreachable for hours.

Does anyone else have examples of making this kind of small application setup working on a droplet or do I need to consider using App Platform instead?

One thing I will mention is that composer needs to install laravel and other dependencies on first run as well as node modules need to be installed on first run. I expected that this might take a little time but to be at 100% CPU usage for hours just does not make sense to me.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Heya, @keneucker

This behaviour is actually very common on small Droplets and usually isn’t a Docker or DigitalOcean issue.

What’s causing it is that CPU-heavy build steps are running at container startup. composer install, npm install, Astro builds, native module compilation, and MySQL initialization are all expensive operations. On a $4 Droplet (and even on 1 vCPU / 2 GB), doing all of this at once will easily peg the CPU at 100% for a long time and make the Droplet appear unreachable, including over SSH.

For production, these steps should not run at runtime. The usual approach is to:

  • Run Composer and Node installs during the Docker image build

  • Build frontend assets ahead of time

  • Deploy pre-built images to the Droplet

Once installs are moved out of startup, container launch time drops from minutes (or hours) to seconds.

More RAM helps a bit, but this is primarily a single-core CPU bottleneck, and Docker adds some overhead on top. App Platform avoids this because builds happen elsewhere, but it’s not required — many people run Laravel + frontend stacks on Droplets successfully once builds are handled in CI or multi-stage Docker builds.

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.