-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yml
63 lines (57 loc) · 1.55 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
61
62
version: '3.4'
services:
weatherclient:
build: ./weatherclient
ports:
- "8085:8085"
tty:
true
restart:
unless-stopped
nginx:
build: ./nginx
ports:
- "8088:80"
# trying to imitate a machine, where Traefik + weatherbackend + Nginx are running all on one machine with DNS active
# therefore trying to configure Docker DNS alias for weatherbackend to Traefik container, which should route it to
# weatherbackend
networks:
default:
aliases:
- weatherbackend.server.test
restart:
always
volumes:
- ./nginx:/etc/nginx/conf.d:ro
traefik:
image: traefik
command:
# - "--logLevel=DEBUG"
- "--api.insecure=true"
# Enabling docker provider
- "--providers.docker=true"
# Do not expose containers unless explicitly told so
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
restart:
always
weatherbackend:
build: ./weatherbackend
labels:
# Explicitly tell Traefik to expose this container
- "traefik.enable=true"
# Allow request only from the predefined entry point named "web"
- "traefik.http.routers.weatherbackend.entrypoints=web"
# The domain the service will respond to
- "traefik.http.routers.weatherbackend.rule=Host(`weatherbackend.server.test`)"
ports:
- "8095"
tty:
true
restart:
unless-stopped