
[traefik]
nginx와 같이 reverse proxy의 종류로 별도의 제어 없이 실행중에 실시간으로 통신 되는 요소끼리 찾아서 연결해주는 기능을 가진 traefik입니다. 대시보드를 통해 실시간으로 어떤 서비스들이 연결되어 있는지 확인할 수 있고, 어떤 서버와 연결되어 있는지 파악 가능합니다.
[Docker-compose로 Traefik 설치 및 구성]
services:
traefik:
image: "traefik:latest"
ports:
- "80:80"
- "8080:8080"
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
apache:
image: "httpd:latest"
labels:
- "traefik.http.routers.apache.rule=Host(`webserver.localhost`)"
- "traefik.http.routers.apache.service=apache-serv"
- "traefik.http.services.apache-serv.loadbalancer.server.port=80"
다음의 docker-compose.yaml을 구성합니다.
kevin@k8s-master:~/docker-traefik$ docker-compose up -d
Creating docker-traefik_traefik_1 ... done
Creating docker-traefik_apache_1 ... done
kevin@k8s-master:~/docker-traefik$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
60e11c524cc2 httpd:latest "httpd-foreground" 10 minutes ago Up 10 minutes 80/tcp docker-traefik_apache_1
a820ee7ef75f traefik:latest "/entrypoint.sh --ap…" 10 minutes ago Up 10 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp docker-traefik_traefik_1
docker-compose up -d 명령어를 통해서 실행시킵니다.
localhost:8080 로 접속하면 dashboard를 만날 수 있습니다.

'Docker' 카테고리의 다른 글
[Docker] Docker-swarm 구축 및 테스트 (0) | 2023.05.29 |
---|---|
[Docker] ERROR x509: certificate has expired or is not yet valid: current time 해결하기 (0) | 2023.05.25 |
Install Compose standalone (0) | 2023.05.17 |
[CI/CD] Docker Jenkins - git webhook - deploy 시연 영상 (0) | 2023.04.28 |
[CI구축] Docker - Github Action - DockerHub (1) | 2023.04.04 |
댓글