Skip to content

Instantly share code, notes, and snippets.

@PankovAlxndr
Created March 6, 2023 06:42
Show Gist options
  • Select an option

  • Save PankovAlxndr/2af7fd030aea398c216b992cb2e8caf2 to your computer and use it in GitHub Desktop.

Select an option

Save PankovAlxndr/2af7fd030aea398c216b992cb2e8caf2 to your computer and use it in GitHub Desktop.
traefik
version: "3.8"
services:
traefik:
container_name: traefik
image: traefik:latest
command:
- --providers.docker
- --providers.docker.exposedByDefault=false
- --providers.file.filename=/etc/traefik/traefik-certs.yml
- --providers.file.watch=true
- --entrypoints.http.address=:80
- --entrypoints.https.address=:443
- --api.dashboard=true
- --api.insecure=true
ports:
- "80:80"
- "8080:8080"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./traefik-certs.yml:/etc/traefik/traefik-certs.yml"
- "./cert/:/etc/traefik/certs"
nginx:
container_name: nginx
image: nginx:1.23-alpine
labels:
- "traefik.enable=true"
- "traefik.http.routers.nginx.rule=Host(`nginx.localhost`)"
- "traefik.http.routers.nginx.entrypoints=https"
- "traefik.http.routers.nginx.tls=true"
- "traefik.http.services.nginx.loadBalancer.server.port=80"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment