I just set up traefik using docker, following the tutorial.
traefik docker-compose.yml
version: '3'
services:
reverse-proxy:
# The official v2 Traefik docker image
image: traefik:v2.11
# Enables the web UI and tells Traefik to listen to docker
command: --api.insecure=true --providers.docker
ports:
# The HTTP port
- "80:80"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
whoami:
# A container that exposes an API to show its IP address
image: traefik/whoami
labels:
- "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost`)"
pastebin docker-compose.yml
version: '3.3'
services:
pastebin:
image: wantguns/bin
container_name: pastebin
environment:
- BIN_PORT=6163
- BIN_LIMITS={form="16 MiB"}
- BIN_CLIENT_DESC=placeholder
volumes:
- pastebin:/upload # upload folder will have your pastes
labels:
- "traefik.http.routers.pastebin.rule=Host(`bin.mydomain.com`)"
volumes:
pastebin: {}
When I try to visit bin.mydomain.com (which has an A record to the IP of my server), it loads for a few minutes in the browser and then the request times out.
However, pinging the "whoami" service I created following the tutorial on the server console works.