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.

Revisions

  1. PankovAlxndr created this gist Mar 6, 2023.
    35 changes: 35 additions & 0 deletions yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    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"