Engineering Note
Moving to Docker should simplify deployments. Ours became more complicated.
We moved a Rails application to Docker expecting smoother deployments and consistent environments.
Instead, we ended up with:
* Bigger images (3GB+)
* Slower CI builds (20+ minutes)
* Different behaviour between local and production
* Containers doing too many things at once
Docker wasn't the problem.
How we were using it was.
So we simplified the approach:
* Switched to a multi-stage build
* Used a minimal base image
* Kept one responsibility per container
* Removed unnecessary packages and build tools from production images
The impact was immediate:
* Image size reduced by more than 60%
* CI build time dropped significantly
* Faster deployments
* Smaller attack surface
The biggest lesson?
Containerising a Rails app isn't about putting it inside Docker.
It's about making deployments simpler, more predictable, and easier to operate.
Adding Docker should reduce complexity.
If it adds three more layers to debug, it's time to rethink the architecture.
Instead, we ended up with:
* Bigger images (3GB+)
* Slower CI builds (20+ minutes)
* Different behaviour between local and production
* Containers doing too many things at once
Docker wasn't the problem.
How we were using it was.
So we simplified the approach:
* Switched to a multi-stage build
* Used a minimal base image
* Kept one responsibility per container
* Removed unnecessary packages and build tools from production images
The impact was immediate:
* Image size reduced by more than 60%
* CI build time dropped significantly
* Faster deployments
* Smaller attack surface
The biggest lesson?
Containerising a Rails app isn't about putting it inside Docker.
It's about making deployments simpler, more predictable, and easier to operate.
Adding Docker should reduce complexity.
If it adds three more layers to debug, it's time to rethink the architecture.