traefik config

20. helmikuuta 2022 | 145 näyttökertaa

version: "3.3"

services:

  traefik:
    image: "traefik:latest"
    container_name: "traefik"
    command:
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--providers.docker.network=jouluvalot"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.httpchallenge.acme.httpchallenge=true"
      - "--certificatesresolvers.httpchallenge.acme.httpchallenge.entrypoint=web"
      - "--certificatesresolvers.httpchallenge.acme.email=<name>@imap.fi"
      - "--certificatesresolvers.httpchallenge.acme.storage=/letsencrypt/acme.json"
      - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
      - "--entrypoints.web.http.redirections.entryPoint.scheme=https"
      - "--entrypoints.web.http.redirections.entrypoint.permanent=true"
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    volumes:
      - "./letsencrypt:/letsencrypt"
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
    networks:
      - jouluvalot
    restart: unless-stopped

networks:
  jouluvalot:
    external: true