Skip to content

Instantly share code, notes, and snippets.

@tamtakoe
Created October 26, 2023 13:36
Show Gist options
  • Save tamtakoe/d601a68342282375e92b35bb5b8554c7 to your computer and use it in GitHub Desktop.
Save tamtakoe/d601a68342282375e92b35bb5b8554c7 to your computer and use it in GitHub Desktop.
version: "3.9"
services:
my-service:
image: my-service:latest
deploy:
replicas: 1
restart_policy:
condition: on-failure
labels:
- traefik.enable=true
- traefik.http.services.my-service.loadbalancer.server.port=8080
- traefik.http.middlewares.https-redirect.redirectscheme.scheme=https
- traefik.http.middlewares.https-redirect.redirectscheme.permanent=true
- traefik.http.routers.my-service-http.rule=Host(`example.com`)
- traefik.http.routers.my-service-http.entrypoints=http
- traefik.http.routers.my-service-http.middlewares=https-redirect
- traefik.http.routers.my-service-https.rule=Host(`example.com`)
- traefik.http.routers.my-service-https.entrypoints=https
- traefik.http.routers.my-service-https.tls=true
- traefik.http.routers.my-service-https.tls.certresolver=le
networks:
- traefik-public
networks:
traefik-public:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment