An open API service indexing awesome lists of open source software.

https://github.com/aaykacc/traefik-docker

Traefik Docker Compose setup with Let's Encrypt, Basic Auth, and HTTPS redirection.
https://github.com/aaykacc/traefik-docker

docker docker-compose lets-encrypt load-balancer reverse-proxy traefik

Last synced: about 2 months ago
JSON representation

Traefik Docker Compose setup with Let's Encrypt, Basic Auth, and HTTPS redirection.

Awesome Lists containing this project

README

          

# Traefik Docker Compose Setup

This repository provides a Docker Compose setup for Traefik, a modern reverse proxy and load balancer. It includes:
- Automatic HTTPS with Let's Encrypt.
- Secure access to the Traefik Dashboard with Basic Authentication.
- HTTP to HTTPS redirection.

## Prerequisites

- Docker and Docker Compose installed.
- A domain name (e.g., `example.com`) pointed to your server's IP address.

## Setup

1. Clone this repository:

```bash
git clone https://github.com/your-username/traefik-docker.git
cd traefik-docker

3. Generate Basic Authentication
The Traefik Dashboard is protected with Basic Authentication. To generate a new username and password hash, use the following command:

> **Note:** When used in docker-compose.yml, all dollar signs ($) in the hash need to be doubled ($$) for escaping. [More details](https://doc.traefik.io/traefik/middlewares/http/basicauth/)
```bash
htpasswd -nb admin securepassword

5. Update the docker-compose.yml file:
- Replace your email for Let's Encrypt.
- Replace your domain for the Traefik Dashboard.
- Replace the Basic Auth hash with your own (use htpasswd to generate it).

4. Create the external Docker network
Run the following command to create the external Docker network:

```bash
docker network create ingress-controller

6. Start the Traefik service:
Start the Traefik service using Docker Compose:

```bash
docker-compose up -d

## Contributing

Feel free to open issues or submit pull requests for improvements.