forked from Ivasoft/traefik
Fix Getting started
This commit is contained in:
@@ -5,9 +5,6 @@ A Simple Use Case Using Docker
|
||||
|
||||

|
||||
|
||||
!!! tip
|
||||
To save some time, you can clone [Traefik's repository](https://github.com/containous/traefik).
|
||||
|
||||
## Launch Traefik With the Docker Provider
|
||||
|
||||
Create a `docker-compose.yml` file where you will define a `reverse-proxy` service that uses the official Traefik image:
|
||||
@@ -18,7 +15,7 @@ version: '3'
|
||||
services:
|
||||
reverse-proxy:
|
||||
image: traefik # The official Traefik docker image
|
||||
command: --api --docker # Enables the web UI and tells Traefik to listen to docker
|
||||
command: --api --providers.docker # Enables the web UI and tells Traefik to listen to docker
|
||||
ports:
|
||||
- "80:80" # The HTTP port
|
||||
- "8080:8080" # The Web UI (enabled by --api)
|
||||
@@ -47,7 +44,7 @@ Edit your `docker-compose.yml` file and add the following at the end of your fil
|
||||
whoami:
|
||||
image: containous/whoami # A container that exposes an API to show its IP address
|
||||
labels:
|
||||
- "traefik.router.rule=Host:whoami.docker.localhost"
|
||||
- "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost`)"
|
||||
```
|
||||
|
||||
The above defines `whoami`: a simple web service that outputs information about the machine it is deployed on (its IP address, host, and so on).
|
||||
|
||||
@@ -29,7 +29,7 @@ Attach labels to your containers and let Traefik do the rest!
|
||||
my-container:
|
||||
# ...
|
||||
labels:
|
||||
- traefik.http.services.my-container.rule=Host(my-domain)
|
||||
- traefik.http.routers.my-container.rule=Host(`my-domain`)
|
||||
```
|
||||
|
||||
??? example "Configuring Docker Swarm & Deploying / Exposing Services"
|
||||
@@ -53,7 +53,7 @@ Attach labels to your containers and let Traefik do the rest!
|
||||
my-container:
|
||||
deploy:
|
||||
labels:
|
||||
- traefik.http.services.my-container.rule=Host(my-domain)
|
||||
- traefik.http.routers.my-container.rule=Host(`my-domain`)
|
||||
```
|
||||
|
||||
!!! important "Labels in Docker Swarm Mode"
|
||||
|
||||
@@ -22,7 +22,7 @@ You can write these configuration elements:
|
||||
|
||||
``` toml
|
||||
# Enabling the file provider
|
||||
[providers.files]
|
||||
[providers.file]
|
||||
|
||||
[http]
|
||||
# Add the router
|
||||
|
||||
Reference in New Issue
Block a user