{
  "id": 12289518,
  "title": "What Splitting a Docker Image Actually Costs You (SPA Routing, CORS, and Five More Surprises)",
  "url": "https://urgent.news/2026/10/06/what-splitting-a-docker-image-actually-costs-you-spa-routing-cors-and",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-06T03:33:27.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/rjeff-sudo/what-splitting-a-docker-image-actually-costs-you-spa-routing-cors-and-five-more-surprises-1e99"
  },
  "original_language": "en",
  "account": "The original plan to combine the Go backend and React frontend into one Docker image seemed simple. However, it revealed several unexpected consequences once they moved to separate images. First, the nginx server handling the frontend had to address the same routing issue the backend previously solved. Second, enabling CORS became necessary when the services ran on different ports. Third, the frontend needed to know the backend's URL, which required setting an environment variable. Fourth, the decision of which Docker image to use in production differed between the frontend and backend, as the latter requires a platform for long-running processes. Lastly, configuration drift emerged, with database credentials scattered across multiple places, leading to recurring bugs.",
  "summary": "A few weeks into DevOps work on our team's chama (savings-group) app, I made a call that seemed simple on paper: ship the Go backend and the React frontend as one combined Docker image, let the backend serve both the API and the static files. It worked. Then, later, the team moved to two separate images instead, one for the backend, one for the frontend behind nginx. That second move is what this…",
  "key_points": [
    "Nginx server must handle frontend routing previously solved by backend",
    "CORS enabled when services run on different ports",
    "Backend URL required as env var for frontend"
  ],
  "editors_take": "Splitting a Docker image into separate backend and frontend components introduces complexities such as routing issues, CORS requirements, environment variable management, and configuration drift, complicating deployment and production setup.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}