Skip to content

Commit 5568e98

Browse files
committed
docs(examples): rewrite traefik example for v3
Addresses Joxit#380, Joxit#396, and Joxit#419
1 parent 7a5e55a commit 5568e98

File tree

5 files changed

+366
-87
lines changed

5 files changed

+366
-87
lines changed

examples/traefik/README.md

Lines changed: 64 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,75 @@
1-
# Traefik example
1+
# Single URL Docker Registry UI for Docker Swarm
22

3-
Host the docker registry ui behind [traefik](http://traefik.io) with Docker Swarm mode.
3+
Swarm-compliant UI with public registry PULLs and authenticated registry PUSHes with Traefik v3.
44

5-
## How to run
5+
## Features
66

7-
Open a terminal console and type
7+
* Unauthenticated PULLs
8+
* Authenticated PUSH/DELETEs
9+
* Single URL (registry and ui on the same domain)
10+
* Let's Encrypt enabled
11+
* Authenticated Traefik Dashboard
812

9-
```bash
10-
bash run-swarm.sh
13+
## Introduction
14+
15+
This configuration is designed to be a "single-serving" quickstart for homelab or development environment.
16+
It is built to be modular enough to easily break apart for larger or more production environments for the
17+
more advanced scenarios.
18+
19+
It serves both a container registry and Joxit's Docker-Registry-UI on the same URL over HTTPS that can be
20+
secured with certificates from Let's Encrypt. The registry allows for public PULLs and authenticated PUSHes.
21+
22+
Additionally, the **traefik** dashboard UI is published (although you do not need it during production) on
23+
port 8443 because [traefik hardcodes](https://doc.traefik.io/traefik/operations/api/#dashboard) the paths
24+
`/dashboard` and `/api`, plus it is just good practice to logically separate your administrative endpoints.
25+
26+
## Prerequisites
27+
28+
### `.env` File
29+
30+
The `.env` file makes it easy to perform all the replacements necessary.
31+
32+
[!TIP]
33+
You may opt to find and replace the variables in the yaml file rather than relying on environment variables.
34+
35+
```shell
36+
DOMAIN=contoso.com
37+
# Leave blank if not using Let's Encrypt
38+
RESOLVER=letsencrypt
39+
# Email address for Let's Encrypt
40+
1141
```
1242

13-
## Authentication
43+
## Uppies
44+
45+
```shell
46+
❯ docker stack deploy -c swarm.yml registry
47+
Creating network registry_frontend
48+
Creating service registry_traefik
49+
Creating service registry_redis
50+
Creating service registry_registry
51+
Creating service registry_ui
52+
Creating service registry_error-pages
53+
```
54+
55+
### Accounts
56+
57+
#### dashboard
58+
59+
Traefik's dashboard account is:
60+
61+
* Username: `admin`
62+
* Password: `hunter2`
63+
64+
#### registry
1465

15-
The registry is protected via __Basic authentication__ but feel free to use whatever you like.
16-
In this sample, credentials are: **admin / admin**.
66+
The registry account is:
1767

18-
To generate a new password for basic auth, run the command: `htpasswd -nb username password`.
68+
* Username: `user`
69+
* Password: `hunter2`
1970

2071
## Contributors
2172

22-
Thank you [@onizet](https://github.com/onizet) for this example.
73+
* [@jnovack](https://github.com/jnovack)
74+
* [@agahkarakuzu](https://github.com/agahkarakuzu)
75+
* [@onizet](https://github.com/onizet)

examples/traefik/acme.json

Whitespace-only changes.

examples/traefik/docker-compose-swarm.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

examples/traefik/run-swarm.sh

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)