Skip to content

Instantly share code, notes, and snippets.

@samuelloza
Created July 22, 2022 02:54
Show Gist options
  • Save samuelloza/5805d202fe3b8dcba607e0a7fd5c0825 to your computer and use it in GitHub Desktop.
Save samuelloza/5805d202fe3b8dcba607e0a7fd5c0825 to your computer and use it in GitHub Desktop.
traefik
version: "3.7"
services:
traefik:
image: traefik:v2.2
command:
- --api.insecure=true
- --providers.docker
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --entrypoints.web.http.redirections.entrypoint.scheme=https
- --entrypoints.web.http.redirections.entrypoint.to=websecure
- --certificatesresolvers.le.acme.email=your-email@gmail.com
- --certificatesresolvers.le.acme.storage=/acme/acme.json
- --certificatesresolvers.le.acme.tlschallenge=true
- --providers.docker.network=traefik-net
- --accesslog
- --log
ports:
- 80:80
- 443:443
volumes:
- ./acme/:/acme/
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- traefik-net
- traefik-internal
networks:
traefik-net:
external: true
traefik-internal:
external: false
@samuelloza
Copy link
Author

samuelloza commented Jul 22, 2022

version: '3'

services:
  front:
    image: ghcr.io/your-organization/image:latest
    labels:
        - traefik.enable=true
        - traefik.http.routers.front-dev.rule=Host(`site.example.org`)
        - traefik.http.routers.front-dev.tls=true
        - traefik.http.routers.front-dev.tls.certresolver=le
        - traefik.http.services.front-dev.loadbalancer.server.port=80
    networks:
        - traefik-net
networks:
  traefik-net:
    external: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment