dotnet / tye

Tye is a tool that makes developing, testing, and deploying microservices and distributed applications easier. Project Tye includes a local orchestrator to make developing microservices easier and the ability to deploy microservices to Kubernetes with minimal configuration.
MIT License
5.28k stars 520 forks source link

Enable access to service in development from remote device #1052

Open marinasundstrom opened 3 years ago

marinasundstrom commented 3 years ago

I use Tye during development, to orchestrate services locally.

I'm developing a mobile app that I want to run on my device, but yet connect to my local computer.

How do I configure Tye so that I can connect to services from a remote device on the same network. For instance, a mobile phone.

Currently, all services are bound to localhost. The host setting does not work.

theperm commented 3 years ago

Thats a very vague question, it would all depend on how you use tye, are u deploying into k8s? You would need to describe your env a bit more.

marinasundstrom commented 3 years ago

I use Tye during development.

How do I bind to the IP address instead of localhost?

daniel-simpson commented 3 years ago

I'd suggest you check out this project: https://github.com/wernight/docker-ngrok

You can run this as a docker image on your local in order to get an externally resolveable address that you can use in your app to talk to your local services.

I'd suggest running this outside of tye (with docker directly), but if you need to you could add something like the following to your tye yaml:

Example in Tye:

  - name: ngrok
    image: wernight/ngrok
    env:
      - "NGROK_PROTOCOL=<your service protocol, e.g. HTTP>"
      - "NGROK_PORT=<your backend service name, e.g. backend>"

Once it's running, check the console output from the ngrok container in order to get your address to use in your app

marinasundstrom commented 3 years ago

@daniel-simpson OK. I will check it out.

marinasundstrom commented 3 years ago

@daniel-simpson Too bad. I'm on a M1 Mac 🙁