Skip to content

Commit

Permalink
Add initial traefik support
Browse files Browse the repository at this point in the history
Adding initial traefik support to start wrapping our web services
with a reverse proxy to keep the number of ports being exposed much
simpler.

Closes redhat-nfvpe#93
  • Loading branch information
leifmadsen committed Mar 14, 2017
1 parent a9969bd commit dd869fa
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PROXY_DOMAIN=toad.tld
PROXY_LOG_LEVEL=DEBUG
50 changes: 33 additions & 17 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
# vim: tabstop=2 shiftwidth=2 expandtab
version: '2'

# docker-compose file to launch jenkins_master/ELK stack instead of VM.
services:
proxy:
image: traefik
command: --web --docker --docker.domain=${PROXY_DOMAIN} --docker.exposedbydefault=false --logLevel=${PROXY_LOG_LEVEL}
ports:
- "80:80"
- "8080:8080"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /dev/null:/traefik.toml

jenkins_master:
build:
context: ./dockerfiles
dockerfile: centos7_base
container_name: jenkins_master
entrypoint: /sbin/init
privileged: true
depends_on:
- proxy
security_opt:
- seccomp:unconfined
volumes:
Expand All @@ -19,15 +31,18 @@ services:
- ./container_data/jenkins/data:/var/lib/jenkins/userContent
- ./container_data/jenkins/log:/var/log/jenkins
- ./container_data/jenkins/jobs:/etc/jenkins_jobs
entrypoint: /sbin/init
ports:
- "8080:8080"
labels:
- "traefik.enable=true"
- "traefik.backend=jenkins_master"
- "traefik.frontend.rule=Host:${PROXY_DOMAIN};Path:/jenkins"
- "traefik.port=8080"
expose:
- "8080"

logstash:
build:
context: ./dockerfiles
dockerfile: centos7_base
container_name: logstash
entrypoint: /sbin/init
privileged: true
security_opt:
Expand All @@ -38,15 +53,13 @@ services:
- ./:/opt/toad
- ./container_data/logstash/config:/etc/logstash/conf.d
- ./container_data/logstash/log:/var/log/logstash/logstash.log
entrypoint: /sbin/init
ports:
- "5044:5044"
expose:
- "5044"

elasticsearch:
build:
context: ./dockerfiles
dockerfile: centos7_base
container_name: elasticsearch
entrypoint: /sbin/init
privileged: true
security_opt:
Expand All @@ -58,25 +71,28 @@ services:
- ./container_data/elasticsearch/log:/var/log/elasticsearch
- ./container_data/elasticsearch/data:/var/lib/elasticsearch
- ./container_data/elasticsearch/config:/etc/elasticsearch
entrypoint: /sbin/init
ports:
- "9200:9200"
expose:
- "9200"

kibana:
build:
context: ./dockerfiles
dockerfile: centos7_base
container_name: kibana
entrypoint: /sbin/init
privileged: true
depends_on:
- proxy
security_opt:
- seccomp:unconfined
volumes:
- /run
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- ./:/opt/toad
- ./container_data/kibana/config:/opt/kibana/config
entrypoint: /sbin/init
ports:
- "443:443"
- "5601:5601"
labels:
- "traefik.enable=true"
- "traefik.backend=kibana"
- "traefik.frontend.rule=Host:${PROXY_DOMAIN};Path:/kibana"
- "traefik.port=5601"
expose:
- "5601"

0 comments on commit dd869fa

Please sign in to comment.