-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.host.yml
156 lines (147 loc) · 5.2 KB
/
docker-compose.host.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
services:
# MongoDB: https://hub.docker.com/_/mongo/
mongo:
image: mongo:6.0
container_name: mongodb
restart: unless-stopped
volumes:
- mongo-data:/data/db
networks:
- graylog-net
opensearch:
image: opensearchproject/opensearch:2.15.0
container_name: opensearch-node1
restart: unless-stopped
env_file:
- .env.opensearch
environment:
- plugins.security.disabled=true
- discovery.type=single-node
- cluster.name=opensearch-cluster
- node.name=opensearch-node1
- bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
- "OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
volumes:
- opensearch-data:/usr/share/opensearch/data
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems
hard: 65536
ports:
- 9200:9200
- 9600:9600 # required for Performance Analyzer
networks:
- opensearch-net
- graylog-net
opensearch-dashboards:
# Initial username and password:
# admin
# admin
# TODO How to change initial password?
image: opensearchproject/opensearch-dashboards:2.15.0
container_name: opensearch-dashboards
restart: unless-stopped
ports:
- 5601:5601
expose:
- "5601"
environment:
OPENSEARCH_HOSTS: '["http://opensearch-node1:9200"]'
# DISABLE_SECURITY_DASHBOARDS_PLUGIN: true # disables security dashboards plugin in OpenSearch Dashboards
networks:
- opensearch-net
- traefik-net
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik-net" # in case of multiple nets this forces to select the correct one
# ROUTER http and http to https redirect MIDDLEWARE
- "traefik.http.middlewares.os-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.os-router.middlewares=os-redirect"
- "traefik.http.routers.os-router.rule=Host('os.placeholderdomain.com')"
- "traefik.http.routers.os-router.entrypoints=web"
# ROUTER https
- "traefik.http.routers.os-router-secure.rule=Host(`os.placeholderdomain.com`)"
- "traefik.http.routers.os-router-secure.entrypoints=websecure"
- "traefik.http.routers.os-router-secure.tls.certresolver=mytlschallenge"
- "traefik.http.services.os-service.loadbalancer.server.port=5601"
# Graylog: https://hub.docker.com/r/graylog/graylog/
graylog:
image: graylog/graylog:5.2
container_name: graylog
restart: unless-stopped
user: root
volumes:
- graylog-data:/usr/share/graylog/data
- ./plugins:/usr/share/graylog/plugin/
# TLS certs
# Important: use *_full.crt in Graylog Input (also includes CA cert)
- ./certs:/usr/share/graylog/certs:ro
env_file:
- .env.graylog
environment:
- GRAYLOG_ROOT_TIMEZONE=Europe/Berlin # replace with your time zone
- GRAYLOG_ELASTICSEARCH_HOSTS=http://opensearch-node1:9200
- GRAYLOG_HTTP_EXTERNAL_URI=https://logs.placeholderdomain.com/
entrypoint: /usr/bin/tini -- wait-for-it opensearch-node1:9200 -- /docker-entrypoint.sh
networks:
- traefik-net
- graylog-net
depends_on:
- mongo
- opensearch
ports:
# Syslog TCP
- "1514:1514"
# Syslog UDP
- "1514:1514/udp"
# GELF TCP
- "12201:12201"
# GELF UDP
- "12201:12201/udp"
# Beats TCP
- "5044:5044"
# Beats TCP
- "5044:5044/udp"
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik-net" # in case of multiple nets this forces to select the correct one
# ROUTER http and http to https redirect MIDDLEWARE
- "traefik.http.middlewares.graylog-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.graylog-router.middlewares=graylog-redirect"
- "traefik.http.routers.graylog-router.rule=Host(`logs.placeholderdomain.com`)"
- "traefik.http.routers.graylog-router.entrypoints=web"
# ROUTER https
- "traefik.http.routers.graylog-router-secure.rule=Host(`logs.placeholderdomain.com`)"
- "traefik.http.routers.graylog-router-secure.entrypoints=websecure"
- "traefik.http.routers.graylog-router-secure.tls.certresolver=mytlschallenge"
- "traefik.http.services.graylog-service.loadbalancer.server.port=9000"
# Get certificates from Traefik reverse proxy.
# This enables Graylog to secure Syslog, FileBeat, etc endpoints.
# For that select certificate in Input config in Graylog.
cert-extract:
image: soerenmetje/acme-certs-extract:latest
restart: unless-stopped
volumes:
# CHANGE PATH TO acme.json dir
- /var/www/traefik/letsencrypt:/acme:ro
- ./certs:/certs
networks:
traefik-net:
external: true
graylog-net:
driver: bridge
opensearch-net:
driver: bridge
driver_opts:
com.docker.network.bridge.enable_icc: "true"
# Volumes for persisting data, see https://docs.docker.com/engine/admin/volumes/volumes/
volumes:
mongo-data:
driver: local
graylog-data:
driver: local
opensearch-data:
driver: local