Skip to content

Instantly share code, notes, and snippets.

@prologic
Created January 9, 2021 03:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prologic/e935cf9b82a9a112096e24e72f5e2c95 to your computer and use it in GitHub Desktop.
Save prologic/e935cf9b82a9a112096e24e72f5e2c95 to your computer and use it in GitHub Desktop.
"Hello World" Go service with Tradfik as Ingress Load Balancer
---
version: "3.8"
services:
hello:
image: r.mills.io/prologic/hello-go
networks:
- traefik
deploy:
mode: replicated
replicas: 3
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.services.hello.loadbalancer.server.port=8000"
- "traefik.http.routers.hello.rule=HostRegexp(`{subdomain:.+}.mills.io`)"
- "traefik.http.routers.hello.priority=1"
- "traefik.http.routers.mills.rule=Host(`mills.io`)"
- "traefik.http.routers.mills.priority=1"
resources:
limits:
cpus: "0.1"
memory: 50M
restart_policy:
condition: on-failure
networks:
traefik:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment