Connecting to a webpage via VPN public URL, but webpage is served on 3001

Hello,

I have a service which serves a webpage on 3000 (HTTP) / 3001 (HTTPS). I have set up my docker-compose file to forward traffic from 80 to 3000, but am unable to connect to the webpage served by my service. How can I make this page viewable from the VPN public URL? Currently if I attempt to connect to my device chrome gives me “ERR_TOO_MANY_REDIRECTS”, and firefox gives a similar error.

My docker-compose.yml looks something like this:

service:
    build: .
    depends_on:
      - service1
      - service2
    expose:
      - "3000"
      - "3001"
    ports:
      - "80:3000"
      - "443:3001"
    volumes:
      - "somevolume"
    labels:
      io.balena.features.dbus: "1"

I am building my service through balena push <app> in the same directory where my docker-compose.yml is located.

How can I successfully point traffic from the VPN public URL to this container?

Thanks.

Hi

If I interpreted correctly wht you are trying to do, I think you don’t have to use the expose and ports directives in the same container for the same purpose. Try using only the ports directiveso that, for example, when you access port 80 on the host, you are forwarding to port 3000 on your container.