
toml file in the custom_services folder that you created with a name of your choice. Now that Traefik knows to parse files in this folder, we can start defining our new service. You will need to add the following to the section of your traefik.toml file, making sure that the path matches the Docker mount point you defined in the previous step: ĭirectory = "/etc/traefik/custom_services"įor completeness, the section of my configuration is as follows: We will do this by following the steps in the file provider documentation.

Next, we need to tell Traefik that this folder exists, and that it holds file providers. path/to/custom_services:/etc/traefik/custom_services path/to/traefik.toml:/etc/traefik/traefik.toml var/run/docker.sock:/var/run/docker.sock Your volumes section now should look something like this: volumes: I have mounted this to /etc/traefik/custom_services, but you can choose virtually any path as long as you account for it in your traefik.toml file later. I named this folder custom_services, and I will be referring to it by this name throughout this post.Īfter you have created your new folder, you will need to expose it to Traefik by adding it to your docker-compose file as a volume. I suggest that you create this in the same folder as your traefik.toml file for convenience.

Even though we will only be making one in this post, it is always good to plan ahead. I also assume that you have a Let’s Encrypt certificate resolver in your configuration, but you can skip this if you choose.įirstly, we will need to make a new folder to hold all of the “custom” services that we will be defining.

This post assumes that you already have a traefik.toml file and a basic docker-compose service for Traefik. If you haven’t already, you should check my last post for a basic Traefik configuration. In short, the answer is yes, and it is reasonably simple to configure using the file provider. Since then, I have had a number of questions on whether or not Traefik can be used as a router for services that are not containerized, or for applications running on other hosts on the network. I very recently posted a step by step guide on setting up Traefik as a reverse proxy for your container-based services. Routing containerless services on Traefik v2
