Hello guys , currently i was developing two things
- react app on port 3001
- node app on port 3000
Later they will work on the same domain, and i want to work that way while developing.
I decided to initiate myself to traefik for this need ..
version: '3.7'
services:
traefik:
image: traefik:v2.2
command:
- --api.insecure=true
# Docker
- --providers.docker
- --providers.docker.exposedByDefault=false
- --providers.docker.network=internal
- --entrypoints.web.address=:80v02.api.letsencrypt.org/directory
# Config
- --accesslog=true
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
whoami:
image: emilevauge/whoami
labels:
- "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost.test`)"
- "traefik.enable=true"
api:
container_name: api
build:
context: .
target: development
labels:
#- "traefik.http.services.api-service.loadbalancer.server.port=3000"
- "traefik.http.routers.api-router.rule=Host(`api.brainstoo.localhost.test`)"
- "traefik.enable=true"
Right now i can access my api with the url : api.brainstoo.localhost.test:3000
But i would like to access it directly with api.brainstoo.localhost.test without the port.
Wether i comment or uncomment the line ** #- "traefik.http.services.apiservice.loadbalancer.server.port=3000"** changes nothing.
I don't know what i m doing wrong. Maybe i did not understand well if traefik would resolve this kind of matters.
Thanks in advance.