Giter VIP home page Giter VIP logo

Comments (5)

mwegner avatar mwegner commented on May 30, 2024

This is a bit out of scope for MagicOnion itself, but port 5000 is the default development port. Very likely this container is listening on port 80. Two options:

  • Redirect port 5000 to 80 in your compose file (- 5000:80 instead of - 5000:5000)
  • Add this line to your Dockerfile: ENV ASPNETCORE_URLS=http://+:5000/

from magiconion.

Nickmiste avatar Nickmiste commented on May 30, 2024

This is a bit out of scope for MagicOnion itself, but port 5000 is the default development port. Very likely this container is listening on port 80. Two options:

  • Redirect port 5000 to 80 in your compose file (- 5000:80 instead of - 5000:5000)
  • Add this line to your Dockerfile: ENV ASPNETCORE_URLS=http://+:5000/

No difference. I'm fairly certain that the server is listening on port 5000 beacuse of the container logs and that fact that I'm able to connect on port 5000 outside of docker.

Container logs:

info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /app

from magiconion.

mwegner avatar mwegner commented on May 30, 2024

Oh huh! I've definitely used ports inside Intel containers on macOS Apple Silicon machines (not with MagicOnion in particular, but I very much doubt that matters).

Maybe something else is already listening on port 5000 at the OS level? I don't think the stuff inside the container will know. You could also try explicitly using 127.0.0.1 instead of localhost, and binding to it in the docker compose definition with: - 127.0.0.1:5000:5000

(And connect to 127.0.0.1 instead of localhost resolution)

from magiconion.

Nickmiste avatar Nickmiste commented on May 30, 2024

Issue resolved. The fix was to have the server listen on 0.0.0.0 instead of localhost.

from magiconion.

mwegner avatar mwegner commented on May 30, 2024

Ah, right! I vaguely remember there being some weirdness around localhost and Docker (the container's "localhost" isn't the same as the host's "localhost" or something along those lines).

from magiconion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.