Skip to content

Commit

Permalink
updated editor base
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Gachuhi committed May 21, 2018
1 parent 6a56b6c commit e81fb59
Show file tree
Hide file tree
Showing 8 changed files with 285 additions and 5 deletions.
209 changes: 209 additions & 0 deletions docker-compose-fluentd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
version: '3.1'
services:
mysql-keycloak:
build: ./mysql
container_name: oli-mysql-keycloak
env_file:
- ./keycloak-mysql/keycloak.envs
volumes:
- /oli/databases/keycloak:/var/lib/mysql
# - keycloak-db:/var/lib/mysql
networks:
- service-tier
depends_on:
- fluentd
logging:
driver: fluentd
options:
fluentd-address: localhost:24224
tag: "oli.oli-mysql-keycloak"
mysql-content:
build: ./mysql
image: oli/mysql
container_name: oli-mysql-content-service
env_file:
- ../content-service/service.envs
ports:
- "3377:3307"
volumes:
- /oli/databases/content:/var/lib/mysql
# - content-db:/var/lib/mysql
networks:
- service-tier
depends_on:
- fluentd
logging:
driver: fluentd
options:
fluentd-address: localhost:24224
tag: "oli.oli-mysql-content"
keycloak-sso:
build: ./keycloak-mysql
image: oli/keycloak-mgysql
container_name: oli-keycloak
env_file:
- ./keycloak-mysql/keycloak.envs
# volumes:
# - /oli/databases/keycloak_dump:/export
networks:
- service-tier
depends_on:
- mysql-keycloak
- fluentd
logging:
driver: fluentd
options:
fluentd-address: localhost:24224
tag: "oli.oli-keycloak"
content:
build: ../content-service
image: oli/content-service
container_name: content-service
env_file:
- ../content-service/service.envs
environment:
- MYSQL_ADDRESS=mysql-content
ports:
- "9110:9990" # for remote deployment
- "8787:8787" # for remote debugging
volumes:
- /oli/content/course_content_xml:/oli/course_content_xml
- /oli/content/course_content_volume:/oli/course_content_volume
- /oli/content/webcontent:/oli/webcontent
- /oli/repository:/oli/repository
networks:
- service-tier
depends_on:
- mysql-content
- fluentd
logging:
driver: fluentd
options:
fluentd-address: localhost:24224
tag: "oli.oli-content-service"
editor:
build: ../course-editor
image: oli/editor
container_name: oli-editor
ports:
- "9000:9000"
networks:
- service-tier
volumes:
- ../course-editor:/app
- ../course-editor/dist:/app/dist
- /app/node_modules
command: npm run dev
logging:
driver: fluentd
options:
fluentd-address: localhost:24224
tag: "oli.oli-editor"
nginx:
build: frontend-nginx
image: oli/nginx
container_name: oli-nginx
volumes:
- ../course-editor/dist:/oli/course-editor/dist
networks:
- service-tier
depends_on:
- fluentd
logging:
driver: fluentd
options:
fluentd-address: localhost:24224
tag: "oli.oli-nginx"
web-assets:
build: ./web-assets-nginx
image: oli/web-assets-nginx
container_name: oli-web-assets-nginx
volumes:
- /oli/content/webcontent:/oli/webcontent/webcontents
- /oli/repository:/oli/repository
- /oli/superactivity:/oli/superactivity
- /oli/branding:/oli/branding
networks:
- service-tier
depends_on:
- fluentd
logging:
driver: fluentd
options:
fluentd-address: localhost:24224
tag: "oli.oli-web-assets"
ssh-server:
build: ./ssh-server
image: oli/ssh-server
container_name: oli-ssh-server
env_file:
- ./ssh-server/ssh.envs
networks:
- service-tier
depends_on:
- fluentd
logging:
driver: fluentd
options:
fluentd-address: localhost:24224
tag: "oli.oli-ssh-server"
# gateway:
# build: ../gateway
# image: oli/gateway
# container_name: oli-gateway
# networks:
# - service-tier
# depends_on:
# - fluentd
# logging:
# driver: fluentd
# options:
# fluentd-address: localhost:24224
# tag: "oli.oli-gateway"
dev.local:
build: ./ha-proxy
image: oli/haproxy
container_name: oli-haproxy
ports:
- "80:80"
- "443:443"
- "2222:2222"
networks:
- service-tier
depends_on:
- nginx
- web-assets
# - gateway
- content
- editor
- ssh-server
- fluentd
logging:
driver: fluentd
options:
fluentd-address: localhost:24224
tag: "oli.oli-haproxy"
fluentd:
build: ./fluentd
image: oli/fluentd
container_name: oli-fluentd
networks:
- service-tier
elasticsearch:
image: elasticsearch
container_name: oli-elasticsearch
expose:
- 9200
networks:
- service-tier
kibana:
image: kibana
container_name: oli-kibana
networks:
- service-tier
#volumes:
# keycloak-db:
# content-db:
networks:
service-tier:
driver: bridge
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ services:
- /oli/content/course_content_xml:/oli/course_content_xml
- /oli/content/course_content_volume:/oli/course_content_volume
- /oli/content/webcontent:/oli/webcontent
- /oli/repository:/oli/repository
networks:
- service-tier
depends_on:
Expand Down Expand Up @@ -82,6 +83,8 @@ services:
volumes:
- /oli/content/webcontent:/oli/webcontent/webcontents
- /oli/repository:/oli/repository
- /oli/superactivity:/oli/superactivity
- /oli/branding:/oli/branding
networks:
- service-tier
ssh-server:
Expand Down
24 changes: 24 additions & 0 deletions fluentd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#FROM fluent/fluentd:v0.12-debian
#RUN ["gem", "install", "fluent-plugin-elasticsearch", "--no-rdoc", "--no-ri", "--version", "1.9.2"]
#COPY fluent.conf /fluentd/etc/fluent.conf

FROM fluent/fluentd:v1.1.3-onbuild

USER root

# below RUN includes plugin as examples elasticsearch is not required
# you may customize including plugins as you wish

RUN apk add --update --virtual .build-deps \
sudo build-base ruby-dev \
&& sudo -u fluent gem install \
fluent-plugin-elasticsearch \
fluent-plugin-record-reformer \
&& sudo -u fluent gem sources --clear-all \
&& apk del .build-deps \
&& rm -rf /var/cache/apk/* \
/home/fluent/.gem/ruby/2.3.0/cache/*.gem

COPY fluent.conf /fluentd/etc/

USER fluent
24 changes: 24 additions & 0 deletions fluentd/fluent.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# fluentd/conf/fluent.conf
<source>
@type forward
port 24224
bind 0.0.0.0
</source>
<match *.**>
@type copy
<store>
@type elasticsearch
host elasticsearch
port 9200
logstash_format true
logstash_prefix fluentd
logstash_dateformat %Y%m%d
include_tag_key true
type_name access_log
tag_key @log_name
flush_interval 1s
</store>
<store>
@type stdout
</store>
</match>
13 changes: 12 additions & 1 deletion ha-proxy/haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ frontend http-in
#bind *:443 ssl crt /certs/combined.pem
#redirect scheme https if !{ ssl_fc }
#reqadd X-Forwarded-Proto:\ https
acl web-assets-acl path_beg /content-swagger /webcontent/
acl web-assets-acl path_beg /content-swagger /webcontents/ /repository/ /superactivity/
#/content-swagger /webcontents
acl frontend-nginx_path path_beg /dist
acl content_path path_beg /content-service/
acl keycloak_path path_beg /auth/
#acl kibana-acl path_beg -i /klogs/ /app/

use_backend web-assets if web-assets-acl
use_backend content if content_path
use_backend keycloak if keycloak_path
use_backend frontend-nginx if frontend-nginx_path
#use_backend kibana if kibana-acl

default_backend devserver

Expand Down Expand Up @@ -64,3 +66,12 @@ backend ssh
mode tcp
server ssh1 oli-ssh-server:22 check
#init-addr last,libc,none resolvers dockerdns

#backend kibana
# mode http
# reqrep ^([^\ ]*)\ /klogs/(.*) \1\ /\2
# ProxyPassReverse /mirror/foo/ http://bk.dom.com/bar
# Note: we turn the urls into absolute in the mean time
# acl hdr_location res.hdr(Location) -m found
# rspirep ^Location:\ (.*)/(.*) Location:\ /klogs/\2 if hdr_location
# server kibana1 kibana:5601 check
5 changes: 2 additions & 3 deletions keycloak-mysql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ RUN java -jar /usr/share/java/saxon.jar \

RUN rm /opt/jboss/keycloak/enableProxy.xsl

COPY themes/ /opt/jboss/keycloak/themes/

USER root
RUN mkdir /export && chown -R jboss:0 /export
COPY themes/ /opt/jboss/keycloak/themes/
RUN chown -R jboss:jboss /opt/jboss/keycloak/themes/ && mkdir /export && chown -R jboss:0 /export
USER jboss

ADD oli_security-realm.json /export/
Expand Down
2 changes: 2 additions & 0 deletions web-assets-nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM nginx:alpine
RUN mkdir -p /oli/webcontent/webcontents
RUN mkdir -p /oli/repository
RUN mkdir -p /oli/superactivity
RUN mkdir -p /oli/branding
RUN mkdir /usr/share/nginx/html/content-swagger
COPY ./swagger/ /usr/share/nginx/html/content-swagger/
COPY ./default.conf /etc/nginx/conf.d
10 changes: 9 additions & 1 deletion web-assets-nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ server {
}

location ^~ /repository {
root /oli/repository;
root /oli;
}

location ^~ /superactivity {
root /oli;
}

location ^~ /branding {
root /oli;
}

error_page 404 /404.html;
Expand Down

0 comments on commit e81fb59

Please sign in to comment.