Skip to content

Commit 5c04c00

Browse files
committed
bump to 1.55 / see changelog
commit 51e65a3 Author: Pascal Andy <[email protected]> Date: Mon Dec 17 18:33:07 2018 -0500 update changelog commit 1b3fb66 Author: Pascal Andy <[email protected]> Date: Mon Dec 17 18:29:37 2018 -0500 readme update commit ded9ba6 Author: Pascal Andy <[email protected]> Date: Mon Dec 17 18:26:18 2018 -0500 readme update commit cb1ccb7 Author: Pascal Andy <[email protected]> Date: Mon Dec 17 18:21:50 2018 -0500 readme update commit a8c6ff5 Author: Pascal Andy <[email protected]> Date: Mon Dec 17 17:57:49 2018 -0500 traefik commit 64a454c Author: Pascal Andy <[email protected]> Date: Mon Dec 17 17:53:58 2018 -0500 traefik commit a694647 Author: Pascal Andy <[email protected]> Date: Mon Dec 17 17:51:47 2018 -0500 traefik commit e8ca33d Author: Pascal Andy <[email protected]> Date: Mon Dec 17 17:48:33 2018 -0500 traefik commit f415876 Author: Pascal Andy <[email protected]> Date: Mon Dec 17 17:44:35 2018 -0500 traefik commit 5e0445a Author: Pascal Andy <[email protected]> Date: Mon Dec 17 17:26:42 2018 -0500 traefik with auth commit 76d7d32 Author: Pascal Andy <[email protected]> Date: Mon Dec 17 17:19:42 2018 -0500 traefik with auth Signed-off-by: Pascal Andy <[email protected]>
1 parent 90d8401 commit 5c04c00

File tree

7 files changed

+97
-85
lines changed

7 files changed

+97
-85
lines changed

CHANGELOG.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11

22
# Changelog
33

4+
## 1.55
5+
- traefik is now using Authentification
6+
47
## 1.54
5-
d2b3a5fa readme udpate
6-
bump to caddy 0.11.1
7-
bump to traefik 1.7.6
8-
remove static files for webapps
8+
- d2b3a5fa readme udpate
9+
- bump to caddy 0.11.1
10+
- bump to traefik 1.7.6
11+
- remove static files for webapps
912

1013
## 1.53
1114
- Added portainer with its agent

traefik_stack5/README.md

+65-59
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
## Introduction
22

3-
This docker stack will run many services (Traefik, Socat, Portainer, Nginx, Caddy, Whoami) in one simple copy-paste command. Please also refer the the [README](https://github.com/pascalandy/docker-stack-this/blob/master/README.md) at the root of this repo.
4-
3+
This docker stack will run many services (Traefik (with Authentification), Socat, Portainer, Nginx, Caddy, Whoami) in one simple copy-paste command. Please also refer the the [README](https://github.com/pascalandy/docker-stack-this/blob/master/README.md) at the root of this repo.
54

65
## Start here
76
1. Go to http://labs.play-with-docker.com/
87
2. Create *one instance*. Wait for the node to provision
98
3. Copy-paste:
109

11-
#### STABLE setup (recommanded)
10+
## Stable setup (recommanded)
1211

1312
```
1413
echo "CONFIGURE ENV_VAR" && \
@@ -25,11 +24,11 @@ cd "$ENV_MONOREPO" && \
2524
./runup.sh;
2625
```
2726

28-
#### EDGE setup (not recommanded)
27+
#### Edge setup (NOT recommanded)
2928

3029
```
3130
echo "CONFIGURE ENV_VAR" && \
32-
ENV_EDGE_BRANCH="1.54";
31+
ENV_EDGE_BRANCH="1.55";
3332
ENV_MONOREPO="traefik_stack5";
3433
3534
echo "Setup the stack" && \
@@ -42,64 +41,99 @@ cd "$ENV_MONOREPO" && \
4241
./runup.sh;
4342
```
4443

45-
The script `runup.sh` will do the hard and deplo the stacks for us. Once deployed, you will see:
44+
This will run `play-with-docker-setup.sh` and `runup.sh`. These scripts will do the hard of deploying the stacks for us.
4645

4746

4847
#### See your stacks
4948

5049
```
5150
$ docker stack ls
5251
53-
NAME SERVICES
54-
toolmonitor 1
55-
toolproxy 2
56-
toolweb 3
52+
NAME SERVICES ORCHESTRATOR
53+
toolgui 2 Swarm
54+
toolproxy 2 Swarm
55+
toolwebapp 4 Swarm
5756
```
5857

5958

6059
#### See your services
6160

6261
```
63-
$ docker service ls
64-
65-
ID NAME MODE REPLICAS IMAGE PORTS
66-
q1oombe6uumc toolmonitor_portainer replicated 1/1 portainer/portainer:1.15.5
67-
8k1ev71vqmdn toolproxy_socat replicated 1/1 devmtl/socatproxy:1.0B
68-
uvcjqggv66pe toolproxy_traefik replicated 1/1 traefik:1.5.0-rc2-alpine *:80->80/tcp,*:8080->8080/tcp
69-
mgpw3g2301mg toolweb_home replicated 2/2 abiosoft/caddy:0.10.10
70-
tim2vt8w9jzj toolweb_who1 replicated 2/2 nginx:1.13.7-alpine
71-
y1r259m435y5 toolweb_who2 replicated 2/2 emilevauge/whoami:latest
62+
docker service ls
63+
64+
ID NAME MODE REPLICAS IMAGE PORTS
65+
ckqzv21zr7ox toolgui_agent global 1/1 portainer/agent:latest
66+
pop0b3w13byv toolgui_portainer replicated 1/1 portainer/portainer:latest
67+
q7sj4lhtvozp toolproxy_socat replicated 1/1 devmtl/socatproxy:1.1
68+
lb3ztruy38lp toolproxy_traefik replicated 1/1 traefik:1.7.6-alpine *:80->80/tcp, *:443->443/tcp, *:8080->8080/tcp
69+
dl1mxwuwq1v5 toolwebapp_home replicated 2/2 abiosoft/caddy:0.11.1-no-stats
70+
72th62aghchk toolwebapp_who1 replicated 2/2 nginx:1.15-alpine
71+
ajdrevkyolv1 toolwebapp_who2 replicated 2/2 emilevauge/whoami:latest
72+
x3nop1l52lok toolwebapp_who3 replicated 2/2 emilevauge/whoami:latest
7273
```
7374

7475
## Confirm that your services (containers) are running
76+
7577
1. When you see that all services are deployed, click on `80` to see the static landing page.
76-
2. From the same URL generated by play-with-docker, in the address bar of your browser, add `/who1/` or `/who2/` or `/portainer/` to access other services.
78+
2. From the same URL generated by play-with-docker, in the address bar of your browser, add `/who1/` or `/who2/` or `/who3/` or `/portainer/` to access other services.
79+
7780

81+
#### Full URL example
7882

79-
#### Example
8083
```
8184
http://pwd10-0-7-3-80.host1.labs.play-with-docker.com/
8285
http://pwd10-0-7-3-80.host1.labs.play-with-docker.com/who1/
8386
http://pwd10-0-7-3-80.host1.labs.play-with-docker.com/who2/
87+
http://pwd10-0-7-3-80.host1.labs.play-with-docker.com/who3/
8488
http://pwd10-0-7-3-80.host1.labs.play-with-docker.com/portainer/
8589
```
8690

8791
The container for the first URL is actually named `home`.
8892

93+
8994
#### Web apps details:
9095
- **/** = [caddy](https://github.com/pascalandy/caddy-securityheader)
9196
- **/who1/** = [caddy](https://github.com/pascalandy/caddy-securityheader)
9297
- **/who2/** = [whoami](https://hub.docker.com/r/emilevauge/whoami/)
9398
- **/portainer/** = [portainer](https://hub.docker.com/r/portainer/portainer/)
9499

95-
Portainer requires a slash `/` at the end of the path. There is something to tweak with Traefik Labels in order for it to accept the proxy the request without the slash `/` at the end.
96100

97-
#### About Caddy
101+
## How to acces Traefik
102+
103+
![traefik](https://user-images.githubusercontent.com/6694151/50121682-86334d80-0227-11e9-8f25-93dd8714d306.jpg)
104+
105+
106+
#### Traefik password
107+
108+
**user**: admin / **pass**: changethispass
109+
110+
This password is encrypted in our configs `.configs/traefik.toml`
111+
112+
To quickly generate yours with htpasswd, use my container:
113+
114+
```
115+
docker run --rm -it devmtl/alpinefire:3.8-D sh -c 'htpasswd -Bbn admin changethispass'
116+
```
117+
118+
This will display:
119+
120+
```
121+
admin:$2y$05$pAfipn3.brdHMI2eWGnYH.84XYqLozp1sUPi36/l54UAwv.zGLtNC
122+
```
123+
124+
Insert this string in your `.configs/traefik.toml`.
125+
126+
#### What is Traefik?
127+
128+
[Traefik](https://docs.traefik.io/configuration/backends/docker/) is a powerful layer 7 reverse proxy. Once running, the proxy will give you access to many web apps. I think this is a solid use cases to understand how this reverse-proxy works.
129+
130+
#### Traefik version
131+
132+
In `toolproxy.yml` look for something like `traefik:1.7.6`.
98133

99-
I made a solid container out of it. See details:
100-
https://github.com/pascalandy/caddy-securityheader
134+
In some mono-repo I **my own traefik image**. Feel free to use the official images. It will not break anything.
101135

102-
#### Anything special about this mono repo?
136+
#### Other stuff to know?
103137

104138
- This stack does not use ACME (https://). ACME is a pain while developping … reaching limits, etc.
105139
- If you don’t want to use socat, checkout the monorepo `traefik-manager-noacme`
@@ -115,7 +149,6 @@ https://github.com/pascalandy/caddy-securityheader
115149

116150
![docker-stack-this-stack5_17](https://user-images.githubusercontent.com/6694151/49540848-1922ce00-f89f-11e8-9fdc-b6fce70825c8.jpg)
117151

118-
119152
## All commands
120153
In the active path, just execute those bash-scripts:
121154

@@ -125,24 +158,9 @@ In the active path, just execute those bash-scripts:
125158

126159
**Bonus!** `./runctop.sh` is not a stack but a simple docker run to see the memory consumed by each containers.
127160

128-
129-
## What is Traefik?
130-
[Traefik](https://docs.traefik.io/configuration/backends/docker/) is a powerful layer 7 reverse proxy. Once running, the proxy will give you access to many web apps. I think this is a solid use cases to understand how this reverse-proxy works.
131-
132-
133-
#### Traefik version
134-
In `toolproxy.yml` look for something like `traefik:1.7.4`.
135-
136-
In some mono-repo I **my own traefik image**. Feel free to use the official images. It will not break anything.
137-
138-
139-
## Backlog
140-
Here is what’s missing to make this stack perfect?
161+
## ToDo
141162

142-
- Secure traefik dashboard
143163
- Use SSL endpoints (ACME)
144-
- Fix the need to use a trailing slash `/` at the end of Portainer service
145-
146164

147165
## Contributing
148166

@@ -160,21 +178,7 @@ Thanks to the power of communities, this is where `1 + 1 = 3`.
160178
- View the **GNU** license information at https://github.com/pascalandy/GNU-GENERAL-PUBLIC-LICENSE
161179
- This Git repo is available at https://github.com/pascalandy/docker-stack-this
162180

163-
164-
## Author
165-
166-
In the world of OSS (open source software) most people refer themselves as maintainers. The thing is… I hate this expression. It feels heavy and not fun. I much prefer author.
167-
168-
169-
#### Hosting
170-
171-
Looking to **kick-start your website** (static page + a CMS) ? Take a look at [play-with-ghost](http://play-with-ghost.com/) (another project I shared). It allows you to see and edit websites made with **Ghost**. In short, you can try Ghost on the spot without having to sign up! Just use the dummy email & password provided.
172-
173-
#### I’m looking for help
174-
175-
If you have solid skills 🤓 with Docker Swarm, Linux bash and the gang and you’re looking to help a startup to launch a solid project, I would love to get to know you. Buzz me 👋 on Twitter [@askpascalandy](https://twitter.com/askpascalandy). You can see the things that are done and the things we have to do [here](http://firepress.org/blog/technical-challenges-we-are-facing-now/).
176-
177-
I’m looking for bright and caring people to join this [journey](http://firepress.org/blog/tag/from-the-heart/) with me.
181+
## Keep in touch
178182

179183
```
180184
____ _ _ _
@@ -185,4 +189,6 @@ I’m looking for bright and caring people to join this [journey](http://firepre
185189
|___/
186190
```
187191

188-
Shared by [Pascal Andy](https://pascalandy.com/blog/now/). Find me on [Twitter](https://twitter.com/askpascalandy).
192+
- Pascal Andy’s [« now page »](https://pascalandy.com/blog/now/)
193+
- Follow me on [Twitter](https://twitter.com/askpascalandy)
194+
- Find more Ghost Themes on [play-with-ghost.com](https://play-with-ghost.com/)

traefik_stack5/config_and_vars.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ set -o pipefail # Use last non-zero exit code in a pipeline
1818
# USE CAPITAL VARS to indicate this VAR comes from outside
1919

2020
# Not used in docker-compose at the moment
21-
readonly TRAEFIK_IMG="traefik:1.7.5-alpine"
21+
echo "no vars here";

traefik_stack5/configs/acme.json

Whitespace-only changes.

traefik_stack5/configs/traefik.toml

+20-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
defaultEntryPoints = ["http"]
22

33
[entryPoints]
4-
[entryPoints.http]
5-
address = ":80"
6-
# compress = false
7-
# [entryPoints.http.redirect]
8-
# entryPoint = "https"
4+
[entryPoints.dashboard]
5+
address = ":8080"
6+
[entryPoints.dashboard.auth]
7+
[entryPoints.dashboard.auth.basic]
8+
users = ["admin:$2y$05$pAfipn3.brdHMI2eWGnYH.84XYqLozp1sUPi36/l54UAwv.zGLtNC"]
9+
[entryPoints.http]
10+
address = ":80"
11+
# [entryPoints.http.redirect]
12+
# entryPoint = "https"
913
# [entryPoints.https]
10-
# address = ":443"
11-
# [entryPoints.https.tls]
12-
# [[entryPoints.https.tls.certificates]]
13-
# CertFile = "/etc/traefik/domain.com.cert"
14-
# KeyFile = "/etc/traefik/domain.com.key"
14+
# address = ":443"
15+
# [entryPoints.https.tls]
16+
17+
[api]
18+
entrypoint="dashboard"
1519

1620
#[acme]
17-
18-
#storage = "/etc/traefik/acme.json"
21+
#email = "your_email@your_domain.net"
22+
#storage = "acme.json"
1923
#entryPoint = "https"
20-
#onDemand = true
21-
#OnHostRule = true
22-
#acmeLogging = true
24+
#caServer = "https://acme-staging-v02.api.letsencrypt.org/directory"
25+
#onHostRule = true
26+
# [acme.httpChallenge]
27+
# entryPoint = "http"

traefik_stack5/runup.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function main() {
8181
function goto_myscript() {
8282

8383
# play-with-docker is ready
84-
docker run --rm devmtl/figlet:1.0 lauching stacks; sleep 2; echo;
84+
docker run --rm devmtl/figlet:1.0 Lauching stacks; sleep 2; echo;
8585

8686
# Stop
8787
echo; echo "If existing, remove stacks: "
@@ -113,6 +113,7 @@ function goto_myscript() {
113113
echo "Start the stacks ...";
114114

115115
# traefik
116+
chmod 600 ./configs/acme.json
116117
docker stack deploy toolproxy -c toolproxy.yml;
117118
echo; sleep 1;
118119

traefik_stack5/toolproxy.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ services:
5353
networks:
5454
- ntw_front
5555
- ntw_proxy
56+
volumes:
57+
- ./configs/acme.json:/acme.json
5658
configs:
5759
- source: traefik.toml
5860
target: /etc/traefik/traefik.toml
@@ -63,7 +65,6 @@ services:
6365
--docker.watch \
6466
--debug=true \
6567
--logLevel=WARN \
66-
--web \
6768
--web.metrics.prometheus \
6869
--web.metrics.prometheus.buckets="0.1,0.3,1.2,5.0" \
6970
--web.address=:8080
@@ -89,10 +90,6 @@ services:
8990
- "traefik.enable=true"
9091
- "traefik.logLevel=DEBUG"
9192
- "traefik.port=8080"
92-
- "traefik.passHostHeader=true"
93-
- "traefik.frontend.entryPoints=http"
94-
- "traefik.backend.loadbalancer.method=wrr"
95-
- "traefik.backend.loadbalancer.swarm=true"
9693

9794

9895
# by Pascal Andy | https://pascalandy.com/

0 commit comments

Comments
 (0)