forked from lucaslorentz/caddy-docker-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
standalone.yaml
103 lines (94 loc) · 2.5 KB
/
standalone.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
version: "3.7"
# used for specific settings you have outside of your docker config
# ex: proxies to external servers, storage configuration...
# remove this block entirely if not needed (Only used for Docker Swarm)
configs:
caddy-basic-content:
file: ./Caddyfile
labels:
caddy:
services:
caddy:
image: lucaslorentz/caddy-docker-proxy:ci-alpine
ports:
- 80:80
- 443:443
networks:
- caddy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# this volume is needed to keep the certificates
# otherwise, new ones will be re-issued upon restart
- caddy_data:/data
deploy:
labels: # Global options
caddy.email: [email protected]
placement:
constraints:
- node.role == manager
replicas: 1
restart_policy:
condition: any
resources:
reservations:
cpus: "0.1"
memory: 200M
# Proxy to service
whoami0:
image: jwilder/whoami
networks:
- caddy
deploy:
labels:
caddy: whoami0.example.com
caddy.reverse_proxy: "{{upstreams 8000}}"
caddy.tls: "internal"
# Proxy to service that you want to expose to the outside world
whoami1:
image: jwilder/whoami
networks:
- caddy
deploy:
labels:
caddy: whoami1.example.com
caddy.reverse_proxy: "{{upstreams 8000}}"
# remove the following line when you have verified your setup
# Otherwise you risk being rate limited by let's encrypt
caddy.tls.ca: https://acme-staging-v02.api.letsencrypt.org/directory
# Proxy to container
whoami2:
image: jwilder/whoami
networks:
- caddy
labels:
caddy: whoami2.example.com
caddy.reverse_proxy: "{{upstreams 8000}}"
caddy.tls: "internal"
# Proxy to container
whoami3:
image: jwilder/whoami
networks:
- caddy
labels:
caddy: whoami3.example.com
caddy.reverse_proxy: "{{upstreams 8000}}"
caddy.tls: "internal"
# Proxy with matches and route
echo_0:
image: brndnmtthws/nginx-echo-headers
networks:
- caddy
deploy:
labels:
caddy: echo0.example.com
[email protected]: "/sourcepath /sourcepath/*"
caddy.route: "@match"
caddy.route.0_uri: "strip_prefix /sourcepath"
caddy.route.1_rewrite: "* /targetpath{path}"
caddy.route.2_reverse_proxy: "{{upstreams 8080}}"
caddy.tls: "internal"
networks:
caddy:
driver: overlay
volumes:
caddy_data: {}