Menu

Post image 1
Post image 2
1 / 2
0

From Docker Compose on My Laptop to OKE in Production — Same App, Zero Rewrites

DEV Community·Pavan Madduri·22 days ago
#lbXkM0wn
#docker#oci#compose#fullscreen#yaml#article
Reading 0:00
15s threshold

I have a rule: if I can't run the full stack on my laptop with docker compose up , the architecture is too complicated. But then you need to deploy to production, and suddenly you're rewriting everything as Kubernetes manifests. The Compose file that worked on your machine is useless. Config lives in two places and they drift apart. Here's the workflow I settled on after trying a bunch of things that didn't work well. The Local Stack Standard web app — API, Redis, Postgres. Three services. # docker-compose.yml services : api : build : . ports : - " 8080:8080" environment : - DATABASE_URL=postgres://app:secret@db:5432/myapp - REDIS_URL=redis://cache:6379 depends_on : db : condition : service_healthy healthcheck : test : [ " CMD" , " curl" , " -f" , " http://localhost:8080/health" ] interval : 10s db : image : postgres:16-alpine environment : POSTGRES_USER : app POSTGRES_PASSWORD : secret POSTGRES_DB : myapp volumes : - pgdata:/var/lib/postgresql/data healthcheck : test : [ " CMD" , " pg_isready" , " -U" , "…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More