I've tried ask question on this forum last time but couldn't get any help. This led me to scrap everything and to start from beginning again.
I am writing a new compose file with traefik.yaml
with very simple setting. Unfortunately Traefik isn't routing any request correctly and just showing default 404 pages. I wish I could get at least a some sort of log, but it doesn't even yield any logs. I am literally plucking my hair out.
# traefik.yaml
providers:
docker:
# endpoint: "tcp://127.0.0.1:2375"
endpoint: "unix:///var/run/docker.sock"
swarmMode: true
network: test-app_web-internal
api:
dashboard: true # must access it via url:${HOSTNAME}/dashboard/
# insecure: true # only for dev mode
debug: true
log:
level: DEBUG
entryPoints:
web:
address: ":80"
web-secure:
address: ":443"
# docker-compose.yaml
version: '3.7'
services:
proxy-traefik:
image: traefik:latest
volumes:
- "./traefik/traefik.dev.yaml:/etc/traefik.yaml"
- "/var/run/docker.sock:/var/run/docker.sock"
ports:
- "80:80"
- "433:433"
- "8080:8080" # dashboard
deploy: # specify configuration for services(not container)
labels:
- traefik.http.routers.proxy-traefik.rule=Host('traefik.127.0.0.1.xip.io')
- traefik.http.services.proxy-traefik.loadbalancer.server.port=8080
- traefik.docker.network=web-internal
placement:
constraints:
- node.role == manager
preferences:
- spread: node.id
networks:
- web-internal
front:
image: test-app-dev_front:latest
ports: # FOR DEBUG PURPOSE - must be disabled in PROD
- "3000:3000"
deploy:
labels:
- traefik.http.routers.web-traefik.rule=Host('127.0.0.1.xip.io')
- traefik.http.routers.web-traefik.entrypoints=web # open to :80,443
- traefik.http.services.web-traefik.loadbalancer.server.port=3000
- traefik.docker.network=web-internal
- traefik.enable=true
volumes:
- "./frontend/src:/node/myapp/src"
- "./frontend/public:/node/myapp/public"
networks:
- web-internal
networks:
web-internal:
name: web-internal
driver: overlay # allows contact different nodes
# attachable: true # outside container can be attached to this network
volumes:
front-node_modules: