I'm trying to get a Hello World up and running but failing miserably.
I started with the basic example Traefik gives with the
whoami image, which works, but as soon as I apply the same config to a custom image I have with a server running, I get an error:
time="2020-02-14T19:30:57Z" level=error msg="port is missing" providerName=docker container=my_custom_image-src-2812cdd4df598b75a9cb03395e72398370ca9e27a9abf531d5f813ee524b42a7
Here is my docker-compose:
version: '3.4' services: traefik: # The official v2.0 Traefik docker image image: traefik:v2.0 # 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: containous/whoami labels: - "traefik.http.routers.whoami.rule=Host(`whoami.whatever.localhost`)" my_custom_image: container_name: my_custom_image image: my_custom_image build: context: ./my_custom_image labels: - "traefik.http.routers.my_custom_image.rule=Host(`my_custom_image.whatever.localhost`)"
Any help would be greatly appreciated.