We can now ask our service to apply our modifications running the following command again from the /srv directory You could use any name if you like considering that it's not already used for another service and that the name stays the same everywhere. It is important to stay consistent with names inside routers and middlewares. I'd like to highlight that I had to double the $ symbols in order to escape the $ symbols as it tries to reference a variable. Version: '3' services: reverse-proxy: restart: always image: traefik:v2.0 ports: - "443:443" - "80:80" volumes: - /srv/traefik.toml:/etc/traefik/traefik.toml - /var/run/docker.sock:/var/run/docker.sock labels: - ".rule=Host(``)" - ".entrypoints=http" - ".middlewares=auth" - ".ers=wilson:$$apr1$$1eZu7RXg$$Ql9Z5AvZNc0Oe4In900mi0" ![]() Let's create our first file /srv/docker-compose.yaml We'll use docker-compose to avoid typing the same command again and again and also enhance it with new configuration elements as this tutorial goes along. It is just as well to install Traefik's binary file, compile it from source, or, just like we'll be doing in this blog post, deploy it with a Docker image. In my case, that server will be 192.168.0.1: it is where ports 80 (HTTP) and 443 (HTTPS) of my internet router (freebox) are forwarded to. Okay, let's set everything up together now :) Setting-up Traefikįirst, you'll need to setup Traefik on a webserver accessible from the internet. You could also emulate a domain name through your local /etc/hosts file, but in such case the generation of a SSL certificate won't be possible. Of course to make it work you will need a domain name ( in my case), and to make sure the different DNS Zones are pointing to your server.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |