-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
157 lines (156 loc) · 4.79 KB
/
docker-compose.yml
File metadata and controls
157 lines (156 loc) · 4.79 KB
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
version: '3.5'
# this docker compose file creates the various services used across all dev platforms at plusForta, including
# * traefik
# * memcached
# * redis
# * mailhog
# * mysql
# * rabbitmq
services:
memcached:
container_name: memcached
image: memcached:alpine
ports:
- 11211:11211
networks:
- internal
restart: unless-stopped
redis:
container_name: redis
image: redis
networks:
- internal
ports:
- "6380:6379"
restart: unless-stopped
mysql:
platform: linux/x86_64
container_name: db
image: mysql:8
networks:
- internal
ports:
- "3316:3306"
volumes:
- dbdata:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
restart: unless-stopped
adminer:
image: adminer
container_name: adminer
restart: unless-stopped
depends_on:
- mysql
- traefik
labels:
- traefik.enable=true
- traefik.http.routers.adminer.rule=Host("db.local.pfdev.de")
- traefik.http.routers.adminer.entrypoints=websecure
- traefik.http.routers.adminer.tls.certresolver=default
- traefik.http.services.adminer.loadbalancer.server.port=8080
networks:
- web
- internal
mailhog:
platform: linux/x86_64
container_name: mailhog
image: mailhog/mailhog:latest
depends_on:
- traefik
ports:
- 1025:1025
labels:
- traefik.enable=true
- traefik.http.routers.mailhog.rule=Host("mail.local.pfdev.de")
- traefik.http.routers.mailhog.entrypoints=websecure
- traefik.http.routers.mailhog.tls.certresolver=default
- traefik.http.services.mailhog.loadbalancer.server.port=8025
networks:
- web
- internal
restart: unless-stopped
rabbitmq:
image: rabbitmq:3-management
hostname: rabbitmq-messenger
container_name: rabbitmq
depends_on:
- traefik
labels:
- traefik.enable=true
- traefik.http.routers.rabbitmq.rule=Host("mq.local.pfdev.de")
- traefik.http.routers.rabbitmq.entrypoints=websecure
- traefik.http.routers.rabbitmq.tls.certresolver=default
- traefik.http.services.rabbitmq.loadbalancer.server.port=15672
networks:
- web
- internal
volumes:
- rabbithole:/var/lib/rabbitmq
restart: unless-stopped
traefik:
container_name: traefik
image: traefik:v2.1
restart: unless-stopped
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
environment:
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_KEY}
AWS_REGION: "eu-central-1"
labels:
# create a router to catch all http traffic and redirect it to https
- "traefik.enable=true"
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.http-catchall.entrypoints=web"
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https@docker"
- "traefik.http.routers.https-catchall.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.https-catchall.entrypoints=websecure"
- "traefik.http.routers.https-catchall.middlewares=errorpage@docker"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
ports:
- 80:80
- 443:443
- 8082:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.yml:/etc/traefik/traefik.yml
- acmedata:/acme
networks:
- web
errorPage:
container_name: errorPage
image: nginx
restart: unless-stopped
depends_on:
- traefik
volumes:
- ./errorPages/html:/usr/share/nginx/html
- ./errorPages/conf:/etc/nginx/conf.d
labels:
- traefik.enable=true
- traefik.http.routers.errorpage.rule=hostregexp(`{host:.+}`)
- traefik.http.routers.errorpage.priority=10
- traefik.http.routers.errorpage.entrypoints=websecure
- traefik.http.routers.errorpage.tls.certresolver=default
- traefik.http.middlewares.errorpage.errors.status=404
- traefik.http.middlewares.errorpage.errors.service=serviceError@docker
- traefik.http.middlewares.errorpage.errors.query=/{status}.html
- traefik.http.services.serviceError.loadbalancer.server.port=80
# note to use this service in another-service when it's running, add the following label:
# - traefik.http.routers.another-service.middlewares: serviceError@docker
# honestly, you probably won't need to do that.
networks:
- web
volumes:
acmedata: # storage for acme.json from traefik
dbdata: # contains mariadb database
rabbithole: # contains rabbitmq exchanges, queues & messages
networks:
web: # defines the network used to connect to traefik in another container
name: web
internal: # defines the network used to connect to all services
name: internal