-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
61 lines (57 loc) · 2.1 KB
/
docker-compose.yml
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
services:
# This is an optional security container.
# This will be used to filter ONLY get requests to the Docker Engine API.
# It stops stuff like https://blog.quarkslab.com/why-is-exposing-the-docker-socket-a-really-bad-idea.html
socket-proxy:
image: tecnativa/docker-socket-proxy
restart: unless-stopped
privileged: true
userns_mode: host # this is needed if https://docs.docker.com/engine/security/userns-remap/#enable-userns-remap-on-the-daemon is setup
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
CONTAINERS: 1 # tell the proxy to grant get requests to /containers/* from the Docker API
networks:
- default # we only want to be able to access this inside this network's container stack
traefik:
image: traefik:v3.2
restart: unless-stopped
command: --log.level=DEBUG
depends_on:
- socket-proxy
ports:
- "80:80"
- "443:443"
volumes:
- ./dynamic_conf.yml:/etc/traefik/dynamic_conf.yml
- ./traefik.yml:/etc/traefik/traefik.yml
- ./certs:/etc/certs:ro
labels:
# Explicitly tell Traefik to expose this container
- traefik.enable=true
# The domain the service will respond to
- traefik.http.routers.reverseproxy.rule=Host(`admin.traefik`)
# Allow request only from the predefined entry point named "web"
- traefik.http.routers.reverseproxy.entrypoints=web
- traefik.http.services.reverseproxy.loadbalancer.server.port=8080
networks:
- proxy
- default # run this container on the default network so it can access the socket-proxy container
whoami:
image: traefik/whoami
restart: unless-stopped
depends_on:
- socket-proxy
- traefik
labels:
# Explicitly tell Traefik to expose this container
- traefik.enable=true
# The domain the service will respond to
- traefik.http.routers.whoami.rule=Host(`whoami.traefik`)
# Allow request only from the predefined entry point named "web"
- traefik.http.routers.whoami.entrypoints=web
networks:
- proxy
networks:
proxy:
name: proxy