-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
171 lines (160 loc) · 4.68 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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
version: "3.7"
services:
#
# Add databases / persistence stores here. e.g. Postgres, MySQL etc.
# You should add one per service for each unique type of storage
#
# Note: it is better to not share a redis instance, that is better set
# on each service that needs it, instead of one monolithic store.
#
# A good convention is to prefix the service type e.g.: db-<db_name>
#
# Uncomment the following if using the accounts-service-skeleton
# db-accounts:
# build:
# context: .
# dockerfile: config/docker/postgres/Dockerfile
# environment:
# POSTGRES_DB: accounts
# POSTGRES_USER: mycompany
# POSTGRES_PASSWORD: secret
# volumes:
# - accounts_db:/var/lib/postgresql/data
# ports:
# - "54321:5432"
# networks:
# - backend
#
# Uncomment the following if using the events-service-skeleton
# db-events:
# build:
# context: .
# dockerfile: config/docker/postgres/Dockerfile
# environment:
# POSTGRES_DB: events
# POSTGRES_USER: mycompany
# POSTGRES_PASSWORD: secret
# volumes:
# - events_db:/var/lib/postgresql/data
# ports:
# - "54322:5432"
# networks:
# - backend
#
# Reverse proxy service
#
# Allows dynamically adding services and making them available via single
# entry point. Traefik is used and listens to the docker socket to do all
# its auto-configuration. See: https://docs.traefik.io for more.
#
# See the docs about service-discovery and dns in: readme-service-discovery.md
#
# Note: if you want to move the CLI config to a traefik.yaml file you must
# remove all the command lines below AND the SSL config must still be loaded
# from a separate file.
#
proxy:
build:
dockerfile: config/docker/proxy/Dockerfile
context: .
command:
- --global.sendAnonymousUsage=false
- --api.insecure=true
- --providers.docker=true
- --providers.docker.exposedByDefault=false
- --entrypoints.web.address=:80
- --entrypoints.web.http.redirections.entryPoint.to=https
- --entrypoints.web.http.redirections.entryPoint.scheme=https
- --entrypoints.https.address=:443
- --providers.file.directory=/etc/traefik/dynamic_conf/
- --providers.file.watch=true
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- backend
labels:
traefik.enable: true
traefik.http.routers.proxy.rule: "Host(`proxy.${PROJECT_DOMAIN:-example.dev}`)"
traefik.http.routers.proxy.tls: true
traefik.http.services.proxy.loadbalancer.server.port: 8080
#
# Shared services
#
dns:
build:
context: .
dockerfile: config/docker/dns/Dockerfile
args:
DNS_HOST_IP: ${DNS_HOST_IP:-127.0.0.1}
PROJECT_DOMAIN: ${PROJECT_DOMAIN:-example.dev}
restart: always
ports:
- "1034:53/udp"
- "5380:8080"
logging:
options:
max-size: 10m
networks:
- backend
labels:
traefik.enable: true
traefik.http.routers.dns.rule: "Host(`dns.${PROJECT_DOMAIN:-example.dev}`)"
traefik.http.routers.dns.tls: true
traefik.http.services.dns.loadbalancer.server.port: 8080
rabbitmq:
image: rabbitmq:3.11-management-alpine
environment:
RABBITMQ_ERLANG_COOKIE: rabbitmqcookienamehere
volumes:
- rabbitmq:/var/lib/rabbitmq
ports:
- "25673:15672"
- "25672:5672"
networks:
- backend
labels:
traefik.enable: true
traefik.http.routers.rabbitmq.rule: "Host(`rabbit.${PROJECT_DOMAIN:-example.dev}`)"
traefik.http.routers.rabbitmq.tls: true
traefik.http.services.rabbitmq.loadbalancer.server.port: 15672
syslog:
build:
context: .
dockerfile: config/docker/logger/Dockerfile
volumes:
- syslog_logs:/var/log/syslog-ng
restart: always
ports:
- "5501:514/udp"
- "5502:601/tcp"
- "5503:6514/tcp"
networks:
- backend
#
# A named network is needed to allow other projects to tap into this network
# block and be resolved by Traefik (proxy) service.
#
networks:
backend:
driver: bridge
name: mycompany_network_backend
#
# These are docker volumes used to provide storage across container re-builds.
# Add one per persistent service and name them appropriately. Remember the
# names must be unique across all docker volumes on your system / prod.
#
# A suggested name is: the {COMPOSE_PROJECT_NAME}_volumes_<service_name>
#
volumes:
accounts_db:
name: mycompany_volumes_accounts-db
events_db:
name: mycompany_volumes_events-db
rabbitmq:
name: mycompany_volumes_rabbitmq
syslog_logs:
name: mycompany_volumes_syslog-logs