</>CodeWithKarani
All of DevOps & Cloud
DevOps & Cloud

Docker & Containers

Images, volumes, compose networking and the permission mismatches.

14 articles

Engineering Craft7 min read

Docker, Finally: A Practical On-Ramp for Developers Who Kept Putting It Off

You are not scared of containers, you are tired of the vocabulary. The mental model in four sentences, four commands, a real multi-stage Dockerfile, a Compose v2 file, and the five things that will confuse you.

Read
Engineering Craft7 min read

Ship to Your Own VPS: GitHub Actions CI/CD Without the Cloud Bill

A complete pipeline for a 10-dollar server: test, build to GHCR, deploy over SSH, health check, roll back. Real workflow YAML with current action versions, plus the details that quietly break deploys.

Read
Databases7 min read

Postgres 'Could Not Resize Shared Memory Segment' Is Not Your Disk

No space left on device from Postgres in Docker means a 64MB /dev/shm, not a full volume. Here is the mechanism, the shm-size fix, and how to size it without inviting the OOM killer.

Read
Databases9 min read

Docker Compose Postgres connection refused: localhost is not your database

Inside a container, localhost means that container. Why your app cannot reach the Postgres service, the service-name fix, and the healthcheck that stops the race condition.

Read
Web & JavaScript7 min read

NEXT_PUBLIC_ Vars Are Baked at Build Time: Why One Docker Image Can't Serve Staging and Prod

Your prod container still points at the staging API because NEXT_PUBLIC_ vars are string-replaced into the client bundle during next build, not read at container start. The two fixes that actually work.

Read
Web & JavaScript7 min read

Next.js 'Found multiple lockfiles': a silent monorepo footgun, not just noise

Next.js picks your workspace root by walking up for a lockfile. A stray one in a Docker layer or template silently changes which files ship. Pin the root explicitly.

Read
Databases7 min read

FATAL: role "postgres" does not exist in Docker: the POSTGRES_USER volume trap

The Postgres Docker image only reads POSTGRES_USER the first time it initializes an empty volume. Change it later and you get a role error that looks like a permissions bug but isn't.

Read
Python & FastAPI9 min read

Error loading ASGI app: why uvicorn cannot import your FastAPI module

Uvicorn resolves 'module:app' against sys.path, not your file's location. The real cause, the right command for flat, package, src and Docker layouts, and how to verify it.

Read
Python & FastAPI7 min read

Why Your FastAPI Logs Vanish Under Gunicorn and Uvicorn (and the Config That Works Everywhere)

FastAPI logs work in local dev but disappear in Docker under gunicorn+uvicorn, especially below WARNING. The cause is disable_existing_loggers and uvicorn's own loggers. Here is the fix.

Read
Frappe/ERPNext7 min read

Redis 'Connection refused' in Frappe: Find the Real Cause, Not Just Restart

Error 111 connecting to localhost:13000 is not a wrong port, it means nothing is listening. Read the real port, ping it, then fix the actual cause per deployment type.

Read
Python & FastAPI7 min read

'No module named pydantic_core._pydantic_core' in Docker or Lambda Is an Architecture Mismatch

This error is not a missing package. pydantic-core ships a compiled Rust wheel, and installing it for the wrong CPU or glibc means the files exist but cannot load.

Read
Python & FastAPI6 min read

pip 'externally-managed-environment': What PEP 668 Protects and the Right Fix

The externally-managed-environment error is PEP 668 stopping pip from corrupting your OS packages. Use a venv, not --break-system-packages, and here is exactly why --user is not reliable.

Read
Databases7 min read

Postgres 'no pg_hba.conf entry for host': the scoped fix, not 0.0.0.0/0

The FATAL: no pg_hba.conf entry error has a two-minute fix that also opens your database to the whole internet. Here is the scoped rule to add instead.

Read
DevOps & Containers8 min read

ImagePullBackOff in Kubernetes: The Five Real Causes and How to Tell Them Apart

ImagePullBackOff is one status hiding five unrelated causes. Read the Events reason string, match it to the cause, and stop restarting the pod.

Read