<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[clouddojo]]></title><description><![CDATA[clouddojo]]></description><link>https://clouddojo.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/64a7a2785730c0e024d9202f/3bae8950-b8c1-4da1-9925-59c6485c1e93.svg</url><title>clouddojo</title><link>https://clouddojo.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 01 Sep 2026 20:10:54 GMT</lastBuildDate><atom:link href="https://clouddojo.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Port 3456 Is Not Available for Serving GraphiQL (Docker Fix)]]></title><description><![CDATA[This is one of those errors that hits almost everyone at least once.
You map ports like this:
ports:
  - "8080:8080"

or
ports:
  - "3457:3456"

and think you're done. Host port on the left, container]]></description><link>https://clouddojo.hashnode.dev/port-3456-is-not-available-for-serving-graphiql-docker-fix</link><guid isPermaLink="true">https://clouddojo.hashnode.dev/port-3456-is-not-available-for-serving-graphiql-docker-fix</guid><category><![CDATA[Docker]]></category><category><![CDATA[Devops]]></category><category><![CDATA[DevOps Interview Questions and Answers]]></category><category><![CDATA[#Devopscommunity]]></category><category><![CDATA[Devops articles]]></category><dc:creator><![CDATA[flickerbot]]></dc:creator><pubDate>Sun, 16 Aug 2026 12:01:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/64a7a2785730c0e024d9202f/ebc7be84-d52f-4a64-95ec-81418592dc31.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is one of those errors that hits almost everyone at least once.</p>
<p>You map ports like this:</p>
<pre><code class="language-plaintext">ports:
  - "8080:8080"
</code></pre>
<p>or</p>
<pre><code class="language-plaintext">ports:
  - "3457:3456"
</code></pre>
<p>and think you're done. Host port on the left, container port on the right. Simple, right?</p>
<p>A team I was helping had a Shopify app running in Docker for local development. Web service and a Postgres container. Postgres came up fine. The web container didn't. Every time it exited before it even finished starting with this error:</p>
<blockquote>
<p>Port 3456 is not available for serving GraphiQL.</p>
</blockquote>
<p><code>docker ps -a</code> showed exit code 1. The logs just repeated the same line. No stack trace. No obvious typo. Just that.</p>
<h2>The thing everyone tries first</h2>
<p>So I did what most of us would do. Saw the word "port" in the error and just swapped it for a random number. Port not available? Change it. Sometimes that works. It's not the best approach and it's not guaranteed. Here it didn't work at all.</p>
<p>Why? Because we never looked at what the actual issue was. We just saw "port" and changed something. Guessing with extra steps.</p>
<p>So next we took the slower route, the one that actually gets you to the answer: reading the logs and the errors properly.</p>
<h2>Read the logs and exit code first</h2>
<p>Two commands, in order:</p>
<pre><code class="language-bash">docker ps -a
</code></pre>
<p>Exit code 1. The process died on purpose, not from something like an OOM kill.</p>
<pre><code class="language-bash">docker logs shopify-app-dev
</code></pre>
<p>Same line again: <code>Port 3456 is not available for serving GraphiQL</code>.</p>
<p>Now the compose file (web service only):</p>
<pre><code class="language-yaml">ports:
  - "3000:3000"
  - "3457:3456"
</code></pre>
<p>Here's the one thing you need to understand about Docker port mapping: <code>host:container</code> is a forwarding rule, not two copies of the same number. <code>"3457:3456"</code> means whatever hits 3457 on your machine gets sent to port 3456 inside the container. Docker sets that up whether or not anything is actually listening on 3456. The forwarding doesn't check.</p>
<p>It's like a postman walking up to your house and trying to deliver a message at the gate. If nobody is sitting at that gate, the message never gets through. The postman doesn't care. He just drops it and leaves.</p>
<p>We analyzed the files and logs, but they can be empty or stale. So we checked what Docker itself thinks is mapped:</p>
<pre><code class="language-bash">docker inspect shopify-app-dev --format '{{json .NetworkSettings.Ports}}'
</code></pre>
<p>Same numbers came back: 3457 to 3456. Mapping is fine. It's just pointed at nothing.</p>
<p>We tried everything else and finally went to the docs. That's where it was: the Shopify CLI binds GraphiQL to port 5000 inside the container. Always. Not configurable from compose. Not something you'd guess.</p>
<h2>What was actually wrong</h2>
<p>The forwarding rule was correct. Every request to 3457 was routed to 3456 with no errors. Nothing was listening on 3456. The Shopify CLI had been bound to 5000 the whole time and the compose file was never updated to match.</p>
<h2>The fix</h2>
<pre><code class="language-yaml"># before
ports:
  - "3000:3000"
  - "3457:3456"

# after
ports:
  - "3000:3000"
  - "3457:5000"
</code></pre>
<pre><code class="language-bash">docker-compose down
docker-compose up --build
</code></pre>
<p>GraphiQL comes up at <code>http://localhost:3457</code>.</p>
<h2>The takeaway</h2>
<p><code>host:container</code> is just a forwarding rule. Docker does not care if anything is listening on the other side.</p>
<p>Next time a container dies with a port error, leave the host number alone at first. Check <code>docker logs</code>, then <code>docker inspect</code>, then find out what port the process inside the container is actually using. That is usually the entire bug.</p>
<p>Based on a real thread from the Shopify developer community.</p>
<h2>FAQ</h2>
<p><strong>What's the difference between host port and container port in Docker?</strong> Host port is what you connect to from your machine. Container port is what the app inside is actually listening on. Docker forwards between them and has no opinion on whether the numbers match, as long as the container-side number matches where the app really binds.</p>
<p><strong>Why does my container exit immediately after starting?</strong> Something inside is crashing on launch, often over a config or port mismatch. Check <code>docker ps -a</code> for the exit code, then <code>docker logs &lt;container&gt;</code>, before you change anything.</p>
<p><strong>What port does the Shopify CLI use for GraphiQL?</strong> Port 5000 inside the container, by default, not configurable via compose.</p>
<p><strong>How do I check what a container actually has mapped, not just what the YAML says?</strong></p>
<pre><code class="language-bash">docker inspect &lt;container&gt; --format '{{json .NetworkSettings.Ports}}'
</code></pre>
<hr />
<p><em>I write these up as I hit them — full version and a few others like it at</em> <a href="https://blogs.clouddojo.in"><em>blogs.clouddojo.in</em></a><em>.</em></p>
]]></content:encoded></item></channel></rss>