pilasguru icon

Ttraefik with simple docker-compose.yaml

pilasguru | PRO | 09/22/21 08:35:46 PM UTC (Edited) | 0 ⭐ | 5106 👁️ | Never ⏰ | []
YAML |

870 B

|

None

|

0 👍

/

0 👎

# http://localhost:8888 -> traefik dashboard
# http://localhost:9999 -> application
 
version: '3'
 
services:
    traefik:
        image: traefik:v2.0
        command:
            - "--api.insecure=true"
            - "--providers.docker=true"
            - "--entryPoints.web.address=:9999"
        ports:
            - 8888:8080
            - 9999:9999
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
 
# docker run --rm -it -p 9999:3000 adongy/hostname-docker
    hostname:
        image: adongy/hostname-docker
        labels:
          - "traefik.enable=true"
          - traefik.http.routers.hostname.rule=Host(`localhost`)
          - traefik.http.middlewares.hostname.compress=true
          - traefik.http.routers.hostname.middlewares=hostname@docker
          - traefik.port=3000
 
# docker-compose up -d --no-deps --scale hostname=5

Comments