Skip to content

Instantly share code, notes, and snippets.

@rbocchinfuso
Created September 23, 2021 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbocchinfuso/5a0cf6492b96edef23309db78df6d11c to your computer and use it in GitHub Desktop.
Save rbocchinfuso/5a0cf6492b96edef23309db78df6d11c to your computer and use it in GitHub Desktop.
Graylog w/ Caddy reverse proxy docker compose YAML file
version: '2'
services:
# MongoDB: https://hub.docker.com/_/mongo/
mongodb:
image: mongo01
networks:
- backend
volumes:
- graylog01_mongo_data_new:/data/db
# Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/7.10/docker.html
elasticsearch:
image: elasticsearch01
networks:
- backend
volumes:
- graylog01_es_data_new:/usr/share/elasticsearch/data
environment:
- http.host=0.0.0.0
- transport.host=localhost
- network.host=0.0.0.0
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 1g
# Graylog: https://hub.docker.com/r/graylog/graylog/
graylog:
image: graylog01
networks:
- caddy
- backend
labels:
caddy: graylog.domain.foo
caddy.reverse_proxy: "{{upstreams 9000}}"
volumes:
- graylog01_graylog_data_new:/usr/share/graylog/data
environment:
# CHANGE ME (must be at least 16 characters)!
- GRAYLOG_PASSWORD_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Password: admin
- GRAYLOG_ROOT_PASSWORD_SHA2=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- GRAYLOG_HTTP_EXTERNAL_URI=https://graylog.domain.foo/
entrypoint: /usr/bin/tini -- wait-for-it elasticsearch:9200 -- /docker-entrypoint.sh
links:
- mongodb:mongo
- elasticsearch
restart: always
depends_on:
- mongodb
- elasticsearch
ports:
# Graylog web interface and REST API
# - 9000:9000
# Syslog TCP
- 1514:1514
# Syslog UDP
- 1637:1637/udp
# GELF TCP
- 12201:12201
# GELF UDP
- 12201:12201/udp
expose:
- 9000
# Volumes for persisting data, see https://docs.docker.com/engine/admin/volumes/volumes/
volumes:
graylog01_mongo_data_new:
external: true
graylog01_es_data_new:
external: true
graylog01_graylog_data_new:
external: true
networks:
caddy:
external: true
backend:
external: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment