<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="313353" data-post-id="313353">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="bdubaut" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bdubaut/120/6614_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  bdubaut
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>From the web terminal I can run <code>curl http://localhost:4000</code> without any issues, I can see the log message in the console. This makes me think that the traffic is actually not reaching the container at all, so I’m scratching my head as to what I’ve misconfigured.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="313353" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/githubs-codespaces/43277/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-313353" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="313353"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="313363" data-post-id="313363">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="arcanemachine" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/arcanemachine/120/29109_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  arcanemachine
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>When I’m having trouble with network configuration on Docker, I sometimes use <code>network_mode: "host"</code> in the compose file to bypass Docker’s networking layer. That way, you can figure out if the problem actually is related to your port config, or if the issue is somewhere else.</p>
<p>Unrelated example for demonstration purposes:</p>
<p><code>compose.yaml</code></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">---
services:
  db:
    image: "docker.io/postgres:16"
    restart: "always"
    environment:
      POSTGRES_DB: "${POSTGRES_DB:?}"
      POSTGRES_USER: "${POSTGRES_USER:-postgres}"
      POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-postgres}"
    network_mode: "host"
    volumes:
      - "postgres:/var/lib/postgresql/data"

volumes:
  postgres:
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="313363" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/githubs-codespaces/43277/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-313363" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="313363"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="313413" data-post-id="313413">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="joddm" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  joddm
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Stupid question, but is the Phoenix server running?<br>
<code>mix phx.server</code></p>
<p>Edit:<br>
Or you can try to edit the ip-mapping in <code>config/dev.exs</code> from<br>
<code>http: [ip: {127, 0, 0, 1}, port: 4000]</code><br>
to<br>
<code>http: [ip: {0, 0, 0, 0}, port: 4000]</code></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="313413" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/githubs-codespaces/43277/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-313413" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="313413"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="313614" data-post-id="313614">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="arcanemachine" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/arcanemachine/120/29109_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  arcanemachine
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Great suggestion. That actually fixed an issue I had when Dockerizing a dev server a month or two ago.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="313614" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/githubs-codespaces/43277/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-313614" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="313614"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="313685" data-post-id="313685">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="bdubaut" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/bdubaut/120/6614_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  bdubaut
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="joddm" data-post="15" data-topic="43277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/j/3ec8ea/48.png" class="avatar"> joddm:</div>
<blockquote>
<p>is the Phoenix server running?</p>
</blockquote>
</aside>
<p>Yes indeed it is</p>
<p><a class="mention" href="/u/arcanemachine" rel="nofollow">@arcanemachine</a> setting <code>network_mode</code> to <code>"host"</code> did not change anthying, I am still getting a 502 with <code>strict-origin-when-when-cross-origin</code> referer policy.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="313685" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/githubs-codespaces/43277/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-313685" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="313685"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="313705" data-post-id="313705">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="joddm" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  joddm
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Did you try to edit the <code>config/dev.exs</code> file?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="313705" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/githubs-codespaces/43277/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-313705" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="313705"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="313987" data-post-id="313987">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="joddm" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  joddm
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>For completeness, here is a working solution:</p>
<p><strong>devcontainer.json</strong></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">{
    "dockerComposeFile": "docker-compose.yml",
    "workspaceFolder": "/workspaces/plfantasy",
    "service": "plfantasy",
    "shutdownAction": "stopCompose",
    "features": {
        "ghcr.io/devcontainers/features/common-utils:2": {
            "installZsh": "true",
            "username": "vscode",
            "userUid": "1000",
            "userGid": "1000",
            "upgradePackages": "true"
        },
        "ghcr.io/devcontainers/features/git:1": {
            "version": "latest",
            "ppa": "false"
        }
    },
    // Configure tool-specific properties.
    "customizations": {
        // Configure properties specific to VS Code.
        "vscode": {
            // Set *default* container specific settings.json values on container create.
            "settings": {
                "emmet.includeLanguages": {
                    "phoenix-heex": "html"
                },
                "tailwindCSS.includeLanguages": {
                    "elixir": "html",
                    "phoenix-heex": "html"
                }
            },
            "extensions": [
                "jakebecker.elixir-ls",
                "phoenixframework.phoenix",
                "samuel-pordeus.elixir-test",
                "bradlc.vscode-tailwindcss",
                "ms-azuretools.vscode-docker",
                "ms-vscode.azurecli",
                "eamodio.gitlens"
            ]
        }
    },
    // Use 'forwardPorts' to make a list of ports inside the container available locally.
    "forwardPorts": [
        4000,
        4001,
        5432
    ],
    // Use 'postCreateCommand' to run commands after the container is created.
    "postCreateCommand": "mix local.hex --force &amp;&amp; mix local.rebar --force &amp;&amp; mix archive.install --force hex phx_new",
    // Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
    "remoteUser": "vscode"
}
</code></pre>
<p><strong>docker-compose.yml</strong></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">version: '3'
services:
  plfantasy:
    build:
      context: ..
      dockerfile: .devcontainer/Dockerfile

    volumes:
      - ../..:/workspaces:cached

    # Overrides default command so things don't shut down after the process ends.
    command: sleep infinity

    environment:
      MIX_ENV: dev

    # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
    network_mode: service:db

    # Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
    # (Adding the "ports" property to this file will not forward from a Codespace.)

  db:
    image: postgres:latest
    restart: unless-stopped
    environment:
      POSTGRES_USER: postgres
      POSTGRES_DB: postgres
      POSTGRES_PASSWORD: postgres
    volumes:
      - postgres-data:/var/lib/postgresql/data
volumes:
  postgres-data:
</code></pre>
<p><strong>Dockerfile</strong></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">FROM hexpm/elixir:1.15.7-erlang-26.1.2-debian-buster-20231009-slim AS elixir-build

RUN apt-get update &amp;&amp; \
  apt-get install -y git &amp;&amp; \
  apt-get install -y postgresql-client &amp;&amp; \
  apt-get install -y inotify-tools &amp;&amp; \
  apt-get install -y curl &amp;&amp; \
  apt-get install -y wget &amp;&amp; \
  apt-get install -y gnupg2 &amp;&amp; \
  apt-get install -y dirmngr &amp;&amp; \
  apt-get install -y gpg &amp;&amp; \
  apt-get install -y gawk
</code></pre>
<p>Note the use of <code>network_mode</code> in docker-compose.yml. I did not need to tweak the IP mapping in <code>config/dev.exs</code></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="313987" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/githubs-codespaces/43277/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-313987" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="313987"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="314719" data-post-id="314719">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="joddm" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  joddm
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The HTML IntelliSense/autocomplete does not seem to work for HEEx/Elixir files in GitHub Codespaces.</p>
<p>Possibly related to <a href="https://github.com/phoenixframework/vscode-phoenix/issues/12" rel="noopener nofollow ugc">Allow extension to be installed in container or remote · Issue #12 · phoenixframework/vscode-phoenix (github.com)</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="314719" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/githubs-codespaces/43277/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-314719" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="314719"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="376106" data-post-id="376106">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Nefcairon" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Nefcairon/120/31921_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Nefcairon
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Do you still prefer gitpod, now that it is Ona?</p>
<p>Is anyone using GitHub Codespaces nowadays? I wonder if I should move my dev setup into the cloud.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="376106" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/githubs-codespaces/43277/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-376106" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="376106"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>