webjocky

Nginx+Traefik 2.x Service Example

May 18th, 2021
768
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. version: "3.8"
  2. services:
  3.   demo:
  4.     image: nginxdemos/hello
  5.     deploy:
  6.       mode: replicated
  7.       replicas: 5
  8.       labels:
  9.         traefik.enable: "true"
  10.         traefik.http.routers.my_service_name.service: "my_service_name"
  11.         traefik.http.routers.my_service_name.rule: "Host(`a.domain.tld`)"
  12.         traefik.http.routers.my_service_name.entrypoints: "http"
  13.         traefik.http.services.my_service_name.loadbalancer.server.port: 80
  14.     networks:
  15.      - traefik-public
  16.  
  17. networks:
  18.   traefik-public:
  19.     external: true
RAW Paste Data