filmov
tv
Running Traefik - HTTP Reverse Proxy and Load Balancer - in Docker
Показать описание
--------------------------------------------------------------------
What is Traefik?
--------------------------------------------------------------------
--------------------------------------------------------------------
Installing Docker
--------------------------------------------------------------------
01. Log into the Linux based device
02. Run the following commands in the terminal
# install prerequisites
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y
# add docker gpg key
# add docker software repository
# install docker
# enable and start docker service
sudo systemctl enable docker && sudo systemctl start docker
# add the current user to the docker group
sudo usermod -aG docker $USER
# reauthenticate for the new group membership to take effect
su - $USER
--------------------------------------------------------------------
Running Traefik
--------------------------------------------------------------------
01. Continue with the following commands in a terminal window
# create a working directory
mkdir ~/docker/traefik -p
# create and edit config file
# Docker configuration backend
providers:
docker:
# API and dashboard configuration
api:
insecure: true
03. Press CTRL+O, Enter, CTRL+X to write the changes
04. Continue with the following commands in a terminal window
# start the traefik container
06. Welcome to the Traefik web dashboard
--------------------------------------------------------------------
Dynamic Container Ingress Testing
--------------------------------------------------------------------
01. Continue with the following commands in a terminal window
# start a basic whoami web service
docker run -d --name whoami -p 40001:80 traefik/whoami
02. Back in the web browser, navigate to whoami.≪% docker host %≫
03. The Apache HTTPD server response should be displayed
04. Back in the Traefik dashboard the new whoami HTTP router should display
05. Let's try one more test
# create an apache2 working directory
mkdir ~/docker/apache2/htdocs -p
# create a test html file
# start a basic apache httpd server
docker run -d --name httpd -p 40002:80 -v ~/docker/apache2/htdocs:/usr/local/apache2/htdocs/ httpd
06. Back in the web browser, navigate to httpd.≪% docker host %≫
07. The Apache HTTPD server response should be displayed
08. Back in the Traefik dashboard the new httpd HTTP router should display
### Connect with me and others ###
Комментарии