Skip to content

A Docker Compose setup of Traefik for Ozone Development

Notifications You must be signed in to change notification settings

mekomsolutions/traefik-docker-compose-dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Traefik v2 HTTPS (SSL) on localhost

Minimal Traefik v2 setup for localhost with HTTPS. TLS is enabled by default for all routers on the websecure entrypoint, so services do not need traefik.http.routers.<name>.tls=true.

Project layout

.
├── config/
│   ├── static.yml   # Traefik static config (entrypoints, providers, API)
│   └── dynamic.yml  # TLS certs, dashboard router
├── certs/           # Create this; put mkcert output here
├── docker-compose.yml
├── whoami.yml       # Example service
└── README.md

Prerequisites

Setup

  1. Clone and go to the project root

    cd traefik-v2-https-ssl-localhost
  2. Install mkcert and generate certificates (first time only)

    mkcert -install
    mkdir -p certs
    mkcert -cert-file certs/local-cert.pem -key-file certs/local-key.pem \
      "docker.localhost" "*.docker.localhost" "domain.local" "*.domain.local"

    On macOS, mkcert may prompt for your password (Keychain + system trust).

  3. Create the Docker network

    docker network create web
  4. Start Traefik

    docker-compose up -d
  5. Start the whoami example (optional)

    docker-compose -f whoami.yml up -d

Access

HTTP (port 80) redirects to HTTPS (port 443).

About

A Docker Compose setup of Traefik for Ozone Development

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •