Skip to content

Commit

Permalink
Update to traefik 3; Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
korridor committed Sep 13, 2024
1 parent 4f16c6b commit 2f372e7
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 40 deletions.
9 changes: 5 additions & 4 deletions configs-local/traefik.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ entryPoints:
address: ":8082"

# Access logs
# accessLog: fields:
# headers:
# names:
# User-Agent: keep
#accessLog:
# fields:
# headers:
# names:
# User-Agent: keep

providers:
docker:
Expand Down
9 changes: 5 additions & 4 deletions configs-prod/traefik.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ entryPoints:
address: ":8082"

# Access logs
# accessLog: fields:
# headers:
# names:
# User-Agent: keep
#accessLog:
# fields:
# headers:
# names:
# User-Agent: keep

providers:
docker:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ networks:
- subnet: 10.100.100.0/24
services:
traefik:
image: traefik:2.11.3
image: traefik:v3.1.2
restart: always
container_name: reverse_proxy_traefik
ports:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ networks:
driver: bridge
services:
traefik:
image: traefik:2.11.3
image: traefik:v3.1.2
restart: always
container_name: reverse_proxy_traefik
ports:
Expand Down
67 changes: 37 additions & 30 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
# Traefik 2 config
# Traefik Setup with Docker Compose


This is a resuseable traefik config for usage on a virtual server or for local debelopment using docker-compose.
This is a reusable Traefik config for usage on a virtual server or for local development using Docker Compose.
It uses:
- Traefik 2
- docker-compose
- Let's encrypt
- [Traefik 3](https://traefik.io/traefik/)
- [Docker](https://www.docker.com/)
- [Let's encrypt](https://letsencrypt.org/) (Optional)

> [!NOTE]
> Check out **solidtime - The modern Open Source Time-Tracker** at [solidtime.io](https://www.solidtime.io)
## Table of content

- [Traefik 2 config](#traefik-2-config)
- [Table of content](#table-of-content)
- [Production setup](#production-setup)
- [Setting up traefik](#setting-up-traefik)
- [Traefik dashboard](#traefik-dashboard)
- [Connect docker compose service to reverse-proxy](#connect-docker-compose-service-to-reverse-proxy)
- [SSL configuration](#ssl-configuration)
- [Global middlewares](#global-middlewares)
- [Access Logs](#access-logs)
- [Setup for local development](#setup-for-local-development)
- [Setting up traefik](#setting-up-traefik-1)
- [Traefik dashboard](#traefik-dashboard-1)
- [Connect docker compose service to reverse-proxy](#connect-docker-compose-service-to-reverse-proxy-1)
- [Enable SSL locally](#enable-ssl-locally)
- [Enable SSL in the docker compose file](#enable-ssl-in-the-docker-compose-file)
- [FAQ](#faq)
- [Credits](#credits)
- [License](#license)
* [Production setup](#production-setup)
+ [Setting up traefik](#setting-up-traefik)
+ [Traefik dashboard](#traefik-dashboard)
+ [Connect docker compose service to reverse-proxy](#connect-docker-compose-service-to-reverse-proxy)
+ [SSL configuration](#ssl-configuration)
+ [Global middlewares](#global-middlewares)
+ [Access Logs](#access-logs)
* [Setup for local development](#setup-for-local-development)
+ [Setting up traefik](#setting-up-traefik-1)
+ [Traefik dashboard](#traefik-dashboard-1)
+ [Connect docker compose service to reverse-proxy](#connect-docker-compose-service-to-reverse-proxy-1)
+ [Enable SSL locally](#enable-ssl-locally)
+ [Enable SSL in the docker compose file](#enable-ssl-in-the-docker-compose-file)
* [FAQ](#faq)
* [Credits](#credits)
* [License](#license)

## Production setup

Expand Down Expand Up @@ -82,14 +79,14 @@ It uses:
```bash
docker compose up -d
```
7. Check that traefik is running smoothly
7. Check that Traefik is running smoothly
```bash
docker compose logs
```

### Traefik dashboard

The traefik dashboard is now available under:
The Traefik dashboard is now available under:
```
https://reverse-proxy.somedomain.com
```
Expand Down Expand Up @@ -198,7 +195,7 @@ Examples:

### Access Logs

To enable the traefik access logs in the production configuration, open the file `traefik.yml` within the config folder and uncomment the `accessLog` section.
To enable the Traefik access logs in the production configuration, open the file `traefik.yml` within the config folder and uncomment the `accessLog` section.

```yml
# Access logs
Expand All @@ -207,7 +204,7 @@ accessLog: {}

## Setup for local development

### Setting up traefik
### Setting up Traefik

1. Clone repository
```bash
Expand Down Expand Up @@ -245,7 +242,7 @@ accessLog: {}

### Traefik dashboard

The traefik dashboard is now available under:
The Traefik dashboard is now available under:
```
http://reverse-proxy.test
```
Expand Down Expand Up @@ -286,7 +283,7 @@ services:
**Specifying port if service exposes multiple ports**
If your service exposes multiple ports traefik does not know which one it should use.
If your service exposes multiple ports Traefik does not know which one it should use.
With this config line you can select one:
```yaml
Expand Down Expand Up @@ -349,6 +346,16 @@ services:
- ...
```
## FAQ
**I have a IPv6-only server, what do I need to change?**
GitHub currently does not support cloning a repository over IPv6. You can clone from my Codeberg mirror instead:
```bash
git clone https://codeberg.org/korridor/reverse-proxy-docker-traefik.git
```

## Credits

I used the following resources to create this setup:
Expand Down

0 comments on commit 2f372e7

Please sign in to comment.