0

How can i add multiple ports

I have nodejs and django application

  webapp:
    image: "python-node-buster"
    ports:
      - "8001:8000"
    command:
      - python manage.py runserver --noreload 0.0.0.0:8000
    networks:
      - django_network


  node:
    image: "python-node-buster"
    ports:
      - "3000:3000"
    stdin_open: true
    networks:
      - node_network


  ngrok:
    image: wernight/ngrok:latest
    ports:
      - 4040:4040
    environment:
      NGROK_PROTOCOL: http
      NGROK_PORT: node:3000
      NGROK_AUTH: ""
    depends_on:
      - node
      - webapp
    networks:
      - node_network
      - django_network

networks:
  django_network:
    driver: bridge
  node_network:
    driver: bridge

Assuming i get the url for node at http://localhost:4040/inspect/http

http://xxxx.ngrok.io

and in my nodejs application, i want to access

http://xxxx.ngrok.io:8001

for apis

How to configure this

Santhosh
  • 9,965
  • 20
  • 103
  • 243
  • I can see the best answer as `https://stackoverflow.com/a/54679176/2897115` which uses nginx – Santhosh Apr 30 '21 at 06:43
  • Does this answer your question? [Ngrok configure multiple port in same domain](https://stackoverflow.com/questions/25522360/ngrok-configure-multiple-port-in-same-domain) – Joshua Swain Nov 24 '21 at 20:34

0 Answers0