Traefik still needs port specification

  amazon-ec2, amazon-web-services, docker, node.js, traefik

I am new to AWS and new with Traefik too. I am having a lot of trouble trying to remove the need of port especification in a application I am developing.

When I hit http://api-landingpage.cayama.com.br/ it give`s me an 404 page error, but when I try http://api-landingpage.cayama.com.br:8001/ it goes to my api correctly.

I hosted my domain in AWS Route53 and I am using docker as a provider.

Here my configurations:

docker-compose.yml:
version: "3"

services:
  app:
    build: .
    ports:
      - "8001:8001"
    
    command: "npm start"

docker-production.yml:

version: "3"

services:
  traefik:
    image: traefik
    command:
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
    ports:
      - "80:80"
      - "8080:8080"

    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

  app:
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.app.rule=Host(`http://api-landingpage.cayama.com.br/`)"
      - "traefik.http.routers.app.entrypoints=web"

I am sure is there a basic thing that I am missing here, can anyone help me please?

I just want to not have to specify, on URL, the port which my application is running.

Thanks guys!

Source: Docker Questions

LEAVE A COMMENT