From 10b7e59d9a754dddbf72b1eb93fb0dcd5b29c799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9as=20Hanss?= Date: Fri, 9 Jun 2017 11:41:15 +0200 Subject: [PATCH 1/7] Updating bootstrap file in order to dispatch logs to graylog instance --- images/apache_php54/Dockerfile | 3 ++- images/apache_php54/bootstrap.sh | 3 +++ images/apache_php56/Dockerfile | 3 ++- images/apache_php56/bootstrap.sh | 3 +++ images/apache_php7/Dockerfile | 3 ++- images/apache_php7/bootstrap.sh | 3 +++ images/solr4/Dockerfile | 3 ++- images/solr4/bootstrap.sh | 3 +++ images/varnish/Dockerfile | 3 ++- images/varnish/bootstrap.sh | 3 +++ 10 files changed, 25 insertions(+), 5 deletions(-) diff --git a/images/apache_php54/Dockerfile b/images/apache_php54/Dockerfile index b1e608c..3c4e210 100644 --- a/images/apache_php54/Dockerfile +++ b/images/apache_php54/Dockerfile @@ -24,7 +24,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ imagemagick \ jpegoptim \ poppler-utils \ - openjdk-7-jre-headless; + openjdk-7-jre-headless \ + netcat; # locale for date, time & currency php functions # q: for what is the locale setup needed ? diff --git a/images/apache_php54/bootstrap.sh b/images/apache_php54/bootstrap.sh index 53b4998..69b0493 100644 --- a/images/apache_php54/bootstrap.sh +++ b/images/apache_php54/bootstrap.sh @@ -55,6 +55,9 @@ trap clean_up SIGTERM service apache2 restart +# Hook to dispatch logs in graylog (Provisional, awaiting smarter & cleaner config) +tail -f /var/log/apache2/access.log |nc -w 1 -u graylog-server 5557 & +tail -f /var/log/apache2/error.log |nc -w 1 -u graylog-server 5557 & echo [`date`] Bootstrap finished diff --git a/images/apache_php56/Dockerfile b/images/apache_php56/Dockerfile index 2c761ad..627b5ce 100644 --- a/images/apache_php56/Dockerfile +++ b/images/apache_php56/Dockerfile @@ -24,7 +24,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ imagemagick \ jpegoptim \ poppler-utils \ - openjdk-7-jre-headless; + openjdk-7-jre-headless \ + netcat; # locale for date, time & currency php functions # q: for what is the locale setup needed ? diff --git a/images/apache_php56/bootstrap.sh b/images/apache_php56/bootstrap.sh index 8307a73..598176c 100644 --- a/images/apache_php56/bootstrap.sh +++ b/images/apache_php56/bootstrap.sh @@ -56,6 +56,9 @@ trap clean_up SIGTERM service apache2 restart +# Hook to dispatch logs in graylog (Provisional, awaiting smarter & cleaner config) +tail -f /var/log/apache2/access.log |nc -w 1 -u graylog-server 5557 & +tail -f /var/log/apache2/error.log |nc -w 1 -u graylog-server 5557 & echo [`date`] Bootstrap finished diff --git a/images/apache_php7/Dockerfile b/images/apache_php7/Dockerfile index bea14ab..5069150 100644 --- a/images/apache_php7/Dockerfile +++ b/images/apache_php7/Dockerfile @@ -25,7 +25,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ imagemagick \ jpegoptim \ poppler-utils \ - openjdk-7-jre-headless; + openjdk-7-jre-headless \ + netcat; # locale for date, time & currency php functions # q: for what is the locale setup needed ? diff --git a/images/apache_php7/bootstrap.sh b/images/apache_php7/bootstrap.sh index 8307a73..598176c 100644 --- a/images/apache_php7/bootstrap.sh +++ b/images/apache_php7/bootstrap.sh @@ -56,6 +56,9 @@ trap clean_up SIGTERM service apache2 restart +# Hook to dispatch logs in graylog (Provisional, awaiting smarter & cleaner config) +tail -f /var/log/apache2/access.log |nc -w 1 -u graylog-server 5557 & +tail -f /var/log/apache2/error.log |nc -w 1 -u graylog-server 5557 & echo [`date`] Bootstrap finished diff --git a/images/solr4/Dockerfile b/images/solr4/Dockerfile index 5fc2e17..59aa008 100644 --- a/images/solr4/Dockerfile +++ b/images/solr4/Dockerfile @@ -13,7 +13,8 @@ RUN echo $DOCKER_TIMEZONE > /etc/timezone; dpkg-reconfigure -f noninteractive tz # Base packages # ----------------------------------------------------------------------------- RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -qqy \ - openjdk-7-jre-headless + openjdk-7-jre-headless \ + netcat; COPY ./solr_4.10 /opt/solr COPY init/solr /etc/init.d/solr diff --git a/images/solr4/bootstrap.sh b/images/solr4/bootstrap.sh index 85d1a78..cfe36fe 100755 --- a/images/solr4/bootstrap.sh +++ b/images/solr4/bootstrap.sh @@ -15,6 +15,9 @@ trap clean_up SIGTERM service solr start +# Hook to dispatch logs in graylog (Provisional, awaiting smarter & cleaner config) +tail -f /opt/solr/logs/solr.log | nc -w 1 -u graylog-server 5556 & + echo [`date`] Bootstrap finished tail -f /dev/null & diff --git a/images/varnish/Dockerfile b/images/varnish/Dockerfile index bc7c489..94bba76 100644 --- a/images/varnish/Dockerfile +++ b/images/varnish/Dockerfile @@ -19,7 +19,8 @@ RUN apt-get update && \ vim \ htop \ procps \ - net-tools; + net-tools \ + netcat; # varnish # ----------------------------------------------------------------------------- diff --git a/images/varnish/bootstrap.sh b/images/varnish/bootstrap.sh index 00e0f34..f341b8b 100755 --- a/images/varnish/bootstrap.sh +++ b/images/varnish/bootstrap.sh @@ -21,6 +21,9 @@ service varnishncsa start varnish-agent +# Hook to dispatch logs in graylog (Provisional, awaiting smarter & cleaner config) +/usr/bin/varnishncsa -a -P /var/run/varnishncsa/varnishncsa.pid -F "{\"method\": \"%m\", \"X-Match\": \"%{X-Match}i\", \"X-Location-Id\": \"%{X-Location-Id}i\"}" | grep -P --line-buffered "(BAN|PURGE)" | nc -w 1 -u graylog-server 5555 & + echo [`date`] Bootstrap finished tail -f /dev/null & From 1192e5e030d55f7514e3a77b72f68852f1286622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9as=20Hanss?= Date: Tue, 13 Jun 2017 12:41:15 +0200 Subject: [PATCH 2/7] Add support for graylog in docker stack --- Readme.md | 8 +++ data/graylog/dump.graylog.gz | Bin 0 -> 14702 bytes data/graylog/inject-graylog-config.sh | 1 + docker-compose-dev-template.yml | 25 +++++++- docs/graylog.md | 88 ++++++++++++++++++++++++++ 5 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 data/graylog/dump.graylog.gz create mode 100644 data/graylog/inject-graylog-config.sh create mode 100644 docs/graylog.md diff --git a/Readme.md b/Readme.md index 80d76be..a7bdf90 100644 --- a/Readme.md +++ b/Readme.md @@ -261,6 +261,14 @@ You can also mount your own bash aliases by mounting a .bash_aliases file in /ho Solr admin interface can be accessed either through port 8983, i.e http://localhost:8983, or with the /solr/ url, i.e http://www.mysite.ezdev/solr/ . +### Check containers logs + +You can various logs for debugging through Graylog stacks. + +Just go to http://127.0.0.1:9000/ and fill the form with admin/admin. + +For further explanations see [this documentation](./docs/graylog.md) + ## Stopping the Environment ./stack.sh down diff --git a/data/graylog/dump.graylog.gz b/data/graylog/dump.graylog.gz new file mode 100644 index 0000000000000000000000000000000000000000..c668b41d8282e27b717af105f006d7032f87f7a6 GIT binary patch literal 14702 zcmYkjbyOTr&@Q~VI{_9CZUKTj!QB@P7Tn!ExVyW%y9N!i5Zra~;10nrzxVs@d+s^= zN6mEgOx4rXv)xZslSLr{07!P>fcMiLPajIDj7x)5fw8?@Don%<+(FjG3F#s`lGGFv z+?bjSmBmzIncT4N)43%onVxxXQ!FMKvWs^$k6xtE;wOxX^&s zy%N=56yx>9PM#IY0iNo~vd9Fm0G`zR>Tp%0_e)P8L^;13)>Kj04-e3Hf#w0zS0Jm} z&*R4h_(nt9*HcdZ8G#E1fM?=YLjDC1ri~+1Th6u@h3tS^07mHs2Ym+sM#75O@XY9( zd|VIXwXh*q|H=kg)^ZDrWkgHSj0g6Gg?!X6zo zu`1^(!zc<;u}T=gn%awzmjl^7OAlXJM1m~F=B zAEO!z|AissNp9j?U3x8fh<|O=++fT6iQN{$V!fxFrACT7S3_wP0ASjHieiN1WU37o zlSnX86c%UyCmRQ>R<~u3Qj=%_)G$MnR7f?sQEO;i*cg!>lHUYG21@-%8ZXda3)PUQ z@z}DXASJwJL{7F`*<3eXad^DLW0V`c{hM`_@N_VJ-o|iXWmJ^5wq{{V_Ih~NHnobr z=DgN?Hn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|VLE5>RPlg?`&=gvkXe_5UQlS77wT+QB~ z)lqtprz^L3zg_O7J4AZbFC8oi-KH@WU==p?4p+g$>oT!RA4NH4!!smz#xB1F1Tbp5 z`-bi@Cs#p`b=rv`Q;y4-Q%niY${i}z{USUzqLZZv(-&tJ!&~wlS>JiWVWAeUFg&LA!weh~+A|~mS*k^XHB)pqu5_Z1wVL$>o@?tLU6oIx zYjHTZ_Lru~we4+<@9MAX>;UAcKIzNT)X<-`4sDHj8hXlqQFEEr=bdDqC4UW5fbVs1 zM(Wm4K4`>R?H^s%Zioujp}Jx{!yDjMwY!s$0@v)Ry!A(u^3<+z0->S=ugn;lG!l%? znp10a?kQN3b5xPmGzcEqKixNecmL+B3qKi|o#Pm#jhlnKYZ5^bDhXUaFQXrZcdfns z649LWI|9B_xQai~NX7NftCgaAGLUJTrzZ8<3DTg|Pw+=IVE~O$)5{NHA7#ym`GRAG z)Ek9NJ5$jKnyZ0gU^e48Jqy3ln( z9kl}fYUv2e9BFI9Y;Gjcd8yf36)Z5RNAl7+&kD?{O^CsHo7sXRhA=%o1@^$`=vx|* ztO^OR9R)EMV0&m!D^=EOF<&z5MYpMQI0{@SQLak`=2*c2dUTBi(yUd{`Zub=#7}n!Jcf< zpD8c3zu$ZdoE4BatPINiq_-E3YkKPXB!k9iJ_!&>q{8VlA3TbF9yyF-ii~6!V??7q zul+`Z^u2+0uai*BrU{k^*r*`e-l#!8o@iq{=A~L2(|tv=uWuO5?J+nw4DF^7A0u7^ zTj2u*Mk^dwjI2*6OmWnDrmy*-oP%pjslb>ehTVSCtyMm1-K +graylog logo +
+ + Graylog - Logs Management Stack +
+ + +

Various log aggregator in order to enhance debugging and monitoring

+ +

+ Kaliop logo +

+
+ +This stack is a poke in order to demonstrate the power of such tool. Please follow the guide to accomplish the walkthrough. + +This library is mainly maintained by [Andréas HANSS](https://github.com/ScreamZ), feel free to contact if you are having some questions. + +# Requirements + +- **Kaliop eZ Docker stack.** https://github.com/kaliop/ezdocker-stack +- **Docker & Docker-compose.** Recent version + +# Introduction + +**Why GRAYLOG ?** + +- Open source log management. +- Scale well in large architecture. +- Embedded user authentication system. +- Embedded alert system on various metrics. +- Support for various format, especially well with [GELF](http://docs.graylog.org/en/2.2/pages/gelf.html). +- Awesome admin & UI. +- Support for LDAP. + +**Why not ELK (Elastic Logstash Kibana)** +- Require [Shield/security](https://www.elastic.co/products/x-pack/security) for user authentication handling (Not free). +- Require [Watcher](https://www.elastic.co/products/x-pack/alerting) for user authentication handling (Not free). +- Heavy costly resources consumption and poor performances. +- Logstash has no UI out-of-the-box, require manual configuration. + +# Setup + +## What is logged + +At the moment you're able to receive following logs : + +- **Varnish BAN / PURGE -** While you're not banning using the Varnish agent tool, take note that it works with back-office BANs. + +- **Apache2 Access/Errors** + +- **Nginx Access/Errors** + +- **SOLR** + + +# Troubleshooting + +**Check docker network** +Your containers might be on different network, feel free to update the docker-compose.yml file accordingly in order to match. + +# Future improvements + +**Pre-bootstrap Mongo with config** +Instead of doing the restore, bootstrap the database at compilation with given parameters. + +**Use log aggregator system** + +- ElasticBEAT with graylog sidecar mode or without. http://docs.graylog.org/en/2.2/pages/collector.html (Deprecated) see http://docs.graylog.org/en/2.2/pages/collector_sidecar.html +- FluentD +- Rsylog / Syslog-NG + +**Think about using LDAP system** + +**Optimize index and stream internally** + +**Find a way to use GELF everywhere** + +- In symfony use monolog with specific wrapper that ignore exception in case of not responsing server + +**Format Apache/NGINX logs upstream in config** \ No newline at end of file From 7cd34a83a437d974fb46194c461de9238a7e5a04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9as=20Hanss?= Date: Wed, 21 Jun 2017 10:14:28 +0200 Subject: [PATCH 3/7] Move mongo dump to config folder --- .../graylog/inject-graylog-config.sh | 0 data/graylog/dump.graylog.gz | Bin 14702 -> 0 bytes docker-compose-dev-template.yml | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename {data => config}/graylog/inject-graylog-config.sh (100%) delete mode 100644 data/graylog/dump.graylog.gz diff --git a/data/graylog/inject-graylog-config.sh b/config/graylog/inject-graylog-config.sh similarity index 100% rename from data/graylog/inject-graylog-config.sh rename to config/graylog/inject-graylog-config.sh diff --git a/data/graylog/dump.graylog.gz b/data/graylog/dump.graylog.gz deleted file mode 100644 index c668b41d8282e27b717af105f006d7032f87f7a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14702 zcmYkjbyOTr&@Q~VI{_9CZUKTj!QB@P7Tn!ExVyW%y9N!i5Zra~;10nrzxVs@d+s^= zN6mEgOx4rXv)xZslSLr{07!P>fcMiLPajIDj7x)5fw8?@Don%<+(FjG3F#s`lGGFv z+?bjSmBmzIncT4N)43%onVxxXQ!FMKvWs^$k6xtE;wOxX^&s zy%N=56yx>9PM#IY0iNo~vd9Fm0G`zR>Tp%0_e)P8L^;13)>Kj04-e3Hf#w0zS0Jm} z&*R4h_(nt9*HcdZ8G#E1fM?=YLjDC1ri~+1Th6u@h3tS^07mHs2Ym+sM#75O@XY9( zd|VIXwXh*q|H=kg)^ZDrWkgHSj0g6Gg?!X6zo zu`1^(!zc<;u}T=gn%awzmjl^7OAlXJM1m~F=B zAEO!z|AissNp9j?U3x8fh<|O=++fT6iQN{$V!fxFrACT7S3_wP0ASjHieiN1WU37o zlSnX86c%UyCmRQ>R<~u3Qj=%_)G$MnR7f?sQEO;i*cg!>lHUYG21@-%8ZXda3)PUQ z@z}DXASJwJL{7F`*<3eXad^DLW0V`c{hM`_@N_VJ-o|iXWmJ^5wq{{V_Ih~NHnobr z=DgN?Hn>USGYv^$0pWfE6YB<2kC$J1#8qf9HUejVQ-DCfv`8aa`NP1CRG@3+Vc~04 znF`zlD6MS^ZU@vdgUPSij*fzDI#|`scJ@E%#gA>5oxV`b+b;<(azlp-fy~E&q|B( z{G~j4^+*|2SSWjq{QJB=cWUUQs_KE%16%KVw%@efq^)Lo%I}-3`u4_DxUW-@x`#5} zB!@LB)))t7)~R+9w{Li%Y26^zA2R!3pEpFb{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<@9MAX>;UAcKIzNT)X<-`4sDHj8hXlqQFEEr=bdDqC4UW5fbVs1 zM(Wm4K4`>R?H^s%Zioujp}Jx{!yDjMwY!s$0@v)Ry!A(u^3<+z0->S=ugn;lG!l%? znp10a?kQN3b5xPmGzcEqKixNecmL+B3qKi|o#Pm#jhlnKYZ5^bDhXUaFQXrZcdfns z649LWI|9B_xQai~NX7NftCgaAGLUJTrzZ8<3DTg|Pw+=IVE~O$)5{NHA7#ym`GRAG z)Ek9NJ5$jKnyZ0gU^e48Jqy3ln( z9kl}fYUv2e9BFI9Y;Gjcd8yf36)Z5RNAl7+&kD?{O^CsHo7sXRhA=%o1@^$`=vx|* ztO^OR9R)EMV0&m!D^=EOF<&z5MYpMQI0{@SQLak`=2*c2dUTBi(yUd{`Zub=#7}n!Jcf< zpD8c3zu$ZdoE4BatPINiq_-E3YkKPXB!k9iJ_!&>q{8VlA3TbF9yyF-ii~6!V??7q zul+`Z^u2+0uai*BrU{k^*r*`e-l#!8o@iq{=A~L2(|tv=uWuO5?J+nw4DF^7A0u7^ zTj2u*Mk^dwjI2*6OmWnDrmy*-oP%pjslb>ehTVSCtyMm1-K Date: Thu, 22 Jun 2017 17:13:09 +0200 Subject: [PATCH 4/7] Add support for graylog stack with filebeat harvesters --- .../filebeat/conf.d/filebeat_apache.conf.yml | 21 ++++++++++++++ .../filebeat/conf.d/filebeat_solr.conf.yml | 16 +++++++++++ .../filebeat/conf.d/filebeat_varnish.conf.yml | 17 +++++++++++ docker-compose-dev-template.yml | 11 +++++++- images/apache_php54/Dockerfile | 3 +- images/apache_php54/bootstrap.sh | 6 +--- images/apache_php56/Dockerfile | 3 +- images/apache_php56/bootstrap.sh | 6 +--- images/apache_php7/Dockerfile | 3 +- images/apache_php7/bootstrap.sh | 6 +--- images/filebeat/Dockerfile | 6 ++++ images/filebeat/service.sh | 28 +++++++++++++++++++ images/solr4/Dockerfile | 5 ++-- images/solr4/bootstrap.sh | 5 +--- images/varnish/Dockerfile | 5 ++-- images/varnish/bootstrap.sh | 5 +--- images/varnish/varnish/default/varnishncsa | 13 +++++++-- stack.sh | 4 +-- 18 files changed, 123 insertions(+), 40 deletions(-) create mode 100644 config/graylog/filebeat/conf.d/filebeat_apache.conf.yml create mode 100644 config/graylog/filebeat/conf.d/filebeat_solr.conf.yml create mode 100644 config/graylog/filebeat/conf.d/filebeat_varnish.conf.yml create mode 100644 images/filebeat/Dockerfile create mode 100644 images/filebeat/service.sh diff --git a/config/graylog/filebeat/conf.d/filebeat_apache.conf.yml b/config/graylog/filebeat/conf.d/filebeat_apache.conf.yml new file mode 100644 index 0000000..297fd31 --- /dev/null +++ b/config/graylog/filebeat/conf.d/filebeat_apache.conf.yml @@ -0,0 +1,21 @@ +###################### Filebeat Configuration for Apache2 ######################### + +# Retrieve logs from services +# @author Andréas 'Screamz' HANSS + +#=========================== Filebeat prospectors ============================= + +filebeat.prospectors: +- input_type: log + paths: + - /app-logs/apache/access.log + document_type: apache_access + +- input_type: log + paths: + - /app-logs/apache/error.log + document_type: apache_error + +#----------------------------- Graylog2 output -------------------------------- +output.logstash: + hosts: ["graylog-server:5044"] diff --git a/config/graylog/filebeat/conf.d/filebeat_solr.conf.yml b/config/graylog/filebeat/conf.d/filebeat_solr.conf.yml new file mode 100644 index 0000000..8910b1e --- /dev/null +++ b/config/graylog/filebeat/conf.d/filebeat_solr.conf.yml @@ -0,0 +1,16 @@ +###################### Filebeat Configuration for Apache SOLR ######################### + +# Retrieve logs from services +# @author Andréas 'Screamz' HANSS + +#=========================== Filebeat prospectors ============================= + +filebeat.prospectors: +- input_type: log + paths: + - /app-logs/solr/solr.log + document_type: solr + +#----------------------------- Graylog2 output -------------------------------- +output.logstash: + hosts: ["graylog-server:5047"] diff --git a/config/graylog/filebeat/conf.d/filebeat_varnish.conf.yml b/config/graylog/filebeat/conf.d/filebeat_varnish.conf.yml new file mode 100644 index 0000000..0f4c55d --- /dev/null +++ b/config/graylog/filebeat/conf.d/filebeat_varnish.conf.yml @@ -0,0 +1,17 @@ +###################### Filebeat Configuration for Varnish NCSA ######################### + +# Retrieve logs from services +# @author Andréas 'Screamz' HANSS + +#=========================== Filebeat prospectors ============================= + +filebeat.prospectors: +- input_type: log + paths: + - /app-logs/varnish/varnishncsa.log + document_type: varnish + include_lines: ['BAN', 'PURGE'] + +#----------------------------- Graylog2 output -------------------------------- +output.logstash: + hosts: ["graylog-server:5046"] diff --git a/docker-compose-dev-template.yml b/docker-compose-dev-template.yml index 91728f5..274418a 100644 --- a/docker-compose-dev-template.yml +++ b/docker-compose-dev-template.yml @@ -175,4 +175,13 @@ services: - mongo - elasticsearch ports: - - "9000:9000" \ No newline at end of file + - "9000:9000" + filebeats: + container_name: graylog-filebeat + #image: TODO_ON_DOCKERHUB_UPLOAD + build: ./images/filebeat + depends_on: + - graylog + volumes: + - ./config/graylog/filebeat:/mnt + - ./logs:/app-logs diff --git a/images/apache_php54/Dockerfile b/images/apache_php54/Dockerfile index 3c4e210..b1e608c 100644 --- a/images/apache_php54/Dockerfile +++ b/images/apache_php54/Dockerfile @@ -24,8 +24,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ imagemagick \ jpegoptim \ poppler-utils \ - openjdk-7-jre-headless \ - netcat; + openjdk-7-jre-headless; # locale for date, time & currency php functions # q: for what is the locale setup needed ? diff --git a/images/apache_php54/bootstrap.sh b/images/apache_php54/bootstrap.sh index 69b0493..b31394a 100644 --- a/images/apache_php54/bootstrap.sh +++ b/images/apache_php54/bootstrap.sh @@ -55,12 +55,8 @@ trap clean_up SIGTERM service apache2 restart -# Hook to dispatch logs in graylog (Provisional, awaiting smarter & cleaner config) -tail -f /var/log/apache2/access.log |nc -w 1 -u graylog-server 5557 & -tail -f /var/log/apache2/error.log |nc -w 1 -u graylog-server 5557 & - echo [`date`] Bootstrap finished tail -f /dev/null & child=$! -wait "$child" \ No newline at end of file +wait "$child" diff --git a/images/apache_php56/Dockerfile b/images/apache_php56/Dockerfile index 627b5ce..2c761ad 100644 --- a/images/apache_php56/Dockerfile +++ b/images/apache_php56/Dockerfile @@ -24,8 +24,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ imagemagick \ jpegoptim \ poppler-utils \ - openjdk-7-jre-headless \ - netcat; + openjdk-7-jre-headless; # locale for date, time & currency php functions # q: for what is the locale setup needed ? diff --git a/images/apache_php56/bootstrap.sh b/images/apache_php56/bootstrap.sh index 598176c..dd5336c 100644 --- a/images/apache_php56/bootstrap.sh +++ b/images/apache_php56/bootstrap.sh @@ -56,12 +56,8 @@ trap clean_up SIGTERM service apache2 restart -# Hook to dispatch logs in graylog (Provisional, awaiting smarter & cleaner config) -tail -f /var/log/apache2/access.log |nc -w 1 -u graylog-server 5557 & -tail -f /var/log/apache2/error.log |nc -w 1 -u graylog-server 5557 & - echo [`date`] Bootstrap finished tail -f /dev/null & child=$! -wait "$child" \ No newline at end of file +wait "$child" diff --git a/images/apache_php7/Dockerfile b/images/apache_php7/Dockerfile index 5069150..bea14ab 100644 --- a/images/apache_php7/Dockerfile +++ b/images/apache_php7/Dockerfile @@ -25,8 +25,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ imagemagick \ jpegoptim \ poppler-utils \ - openjdk-7-jre-headless \ - netcat; + openjdk-7-jre-headless; # locale for date, time & currency php functions # q: for what is the locale setup needed ? diff --git a/images/apache_php7/bootstrap.sh b/images/apache_php7/bootstrap.sh index 598176c..dd5336c 100644 --- a/images/apache_php7/bootstrap.sh +++ b/images/apache_php7/bootstrap.sh @@ -56,12 +56,8 @@ trap clean_up SIGTERM service apache2 restart -# Hook to dispatch logs in graylog (Provisional, awaiting smarter & cleaner config) -tail -f /var/log/apache2/access.log |nc -w 1 -u graylog-server 5557 & -tail -f /var/log/apache2/error.log |nc -w 1 -u graylog-server 5557 & - echo [`date`] Bootstrap finished tail -f /dev/null & child=$! -wait "$child" \ No newline at end of file +wait "$child" diff --git a/images/filebeat/Dockerfile b/images/filebeat/Dockerfile new file mode 100644 index 0000000..5f6db7a --- /dev/null +++ b/images/filebeat/Dockerfile @@ -0,0 +1,6 @@ +FROM docker.elastic.co/beats/filebeat:5.4.2 +USER root +COPY service.sh /root/service.sh +RUN chmod +x /root/service.sh && mkdir /usr/share/filebeat/conf.d/ +WORKDIR /usr/share/filebeat/ +CMD ["/root/service.sh"] diff --git a/images/filebeat/service.sh b/images/filebeat/service.sh new file mode 100644 index 0000000..a4a5a50 --- /dev/null +++ b/images/filebeat/service.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +# Copy config to have file with root owner +cp /mnt/conf.d/* /usr/share/filebeat/conf.d/ +cd /usr/share/filebeat/conf.d/ + +configFileAmount=$(ls -l *.conf.yml | egrep -c '^-') +currentFile=0 + +# Avoid troll config +if [ $configFileAmount -gt 25 ];then + echo "Too much config files detected" + exit 1 +fi + +# Create a worker for each defined service, each one need his own registery so we make a folder for each +for f in *.conf.yml;do + (( currentFile++ )) + if [ $currentFile -eq $configFileAmount ];then + mkdir "workdir-$f" && mv $f "workdir-$f" && cd "workdir-$f" + exec filebeat -c $f + cd .. + else + mkdir "workdir-$f" && mv $f "workdir-$f" && cd "workdir-$f" + filebeat -c $f & + cd .. + fi +done diff --git a/images/solr4/Dockerfile b/images/solr4/Dockerfile index 59aa008..780ae52 100644 --- a/images/solr4/Dockerfile +++ b/images/solr4/Dockerfile @@ -13,8 +13,7 @@ RUN echo $DOCKER_TIMEZONE > /etc/timezone; dpkg-reconfigure -f noninteractive tz # Base packages # ----------------------------------------------------------------------------- RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -qqy \ - openjdk-7-jre-headless \ - netcat; + openjdk-7-jre-headless; COPY ./solr_4.10 /opt/solr COPY init/solr /etc/init.d/solr @@ -32,4 +31,4 @@ EXPOSE 8983 WORKDIR /opt/solr -CMD ["/root/bootstrap.sh"] \ No newline at end of file +CMD ["/root/bootstrap.sh"] diff --git a/images/solr4/bootstrap.sh b/images/solr4/bootstrap.sh index cfe36fe..97d65ed 100755 --- a/images/solr4/bootstrap.sh +++ b/images/solr4/bootstrap.sh @@ -15,11 +15,8 @@ trap clean_up SIGTERM service solr start -# Hook to dispatch logs in graylog (Provisional, awaiting smarter & cleaner config) -tail -f /opt/solr/logs/solr.log | nc -w 1 -u graylog-server 5556 & - echo [`date`] Bootstrap finished tail -f /dev/null & child=$! -wait "$child" \ No newline at end of file +wait "$child" diff --git a/images/varnish/Dockerfile b/images/varnish/Dockerfile index 94bba76..c483e83 100644 --- a/images/varnish/Dockerfile +++ b/images/varnish/Dockerfile @@ -19,8 +19,7 @@ RUN apt-get update && \ vim \ htop \ procps \ - net-tools \ - netcat; + net-tools; # varnish # ----------------------------------------------------------------------------- @@ -46,4 +45,4 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/* EXPOSE 81 EXPOSE 6082 -CMD ["/root/bootstrap.sh"] \ No newline at end of file +CMD ["/root/bootstrap.sh"] diff --git a/images/varnish/bootstrap.sh b/images/varnish/bootstrap.sh index f341b8b..68690e4 100755 --- a/images/varnish/bootstrap.sh +++ b/images/varnish/bootstrap.sh @@ -21,11 +21,8 @@ service varnishncsa start varnish-agent -# Hook to dispatch logs in graylog (Provisional, awaiting smarter & cleaner config) -/usr/bin/varnishncsa -a -P /var/run/varnishncsa/varnishncsa.pid -F "{\"method\": \"%m\", \"X-Match\": \"%{X-Match}i\", \"X-Location-Id\": \"%{X-Location-Id}i\"}" | grep -P --line-buffered "(BAN|PURGE)" | nc -w 1 -u graylog-server 5555 & - echo [`date`] Bootstrap finished tail -f /dev/null & child=$! -wait "$child" \ No newline at end of file +wait "$child" diff --git a/images/varnish/varnish/default/varnishncsa b/images/varnish/varnish/default/varnishncsa index c33ec13..4ea9c8a 100644 --- a/images/varnish/varnish/default/varnishncsa +++ b/images/varnish/varnish/default/varnishncsa @@ -11,7 +11,7 @@ # NCSA log format, to be used by HTTP log analyzers VARNISHNCSA_ENABLED=1 -LOG_FORMAT="%h|%u|%{%Y-%m-%d}t|%{%H:%M:%S}t|%{%z}t|%m|%{Host}i|%U|%q|%s|%b|%{Referer}i|%{User-agent}i|%{Varnish:time_firstbyte}x|%T|%D|%{Varnish:handling}x|%{X-FE-Varnish-Obj-TTL}o|%{X-FE-Varnish-Backend}o|%{X-FE-Varnish-Obj-Stat}o|%{X-Location-Id}i|%{X-PropReference-Id}i" +LOG_FORMAT="%h~%u~%{%Y-%m-%d}t~%{%H:%M:%S}t~%{%z}t~%m~%{Host}i~%U~%q~%s~%b~%{Referer}i~%{User-agent}i~%{Varnish:time_firstbyte}x~%T~%D~%{Varnish:handling}x~%{X-FE-Varnish-Obj-TTL}o~%{X-FE-Varnish-Backend}o~%{X-FE-Varnish-Obj-Stat}o~%{X-Location-Id}i~%{X-Match}i" DAEMON_OPTS="-a -w /var/log/varnish/varnishncsa.log -D -P /var/run/varnishncsa/varnishncsa.pid -F ${LOG_FORMAT}" @@ -83,4 +83,13 @@ DAEMON_OPTS="-a -w /var/log/varnish/varnishncsa.log -D -P /var/run/varnishncsa/v # # 20 %{X-FE-Varnish-Obj-Stat}o # Custom header showing whether request resulted in cache HIT -# or MISS, if HIT, the number of HITs thus far for the object. \ No newline at end of file +# or MISS, if HIT, the number of HITs thus far for the object. +# +# 21 %{X-Location-Id}i +# +# Custom header showing locationID of banned eZPublish contents. +# +# 22 %{X-Match}i +# +# Custom header displaying a url path that will be banned. +# diff --git a/stack.sh b/stack.sh index 3709627..8dffb4a 100755 --- a/stack.sh +++ b/stack.sh @@ -211,7 +211,7 @@ case "$1" in start|run) $DOCKER_COMPOSE -p "$DOCKER_PROJECT_NAME" down - $DOCKER_COMPOSE pull + #$DOCKER_COMPOSE pull $DOCKER_COMPOSE -p "$DOCKER_PROJECT_NAME" up -d ;; @@ -255,4 +255,4 @@ case "$1" in # any other variation, let it go directly through to docker-compose $DOCKER_COMPOSE -p "$DOCKER_PROJECT_NAME" $@ -esac \ No newline at end of file +esac From 677ddab09ff12a5d310acf59422c4d6d3a77ca7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9as=20Hanss?= Date: Thu, 22 Jun 2017 17:18:37 +0200 Subject: [PATCH 5/7] Put again pull on start --- stack.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack.sh b/stack.sh index 2a5d5ab..1be03ae 100755 --- a/stack.sh +++ b/stack.sh @@ -219,7 +219,7 @@ case "$1" in start|run) $DOCKER_COMPOSE -p "$DOCKER_PROJECT_NAME" down - #$DOCKER_COMPOSE pull + $DOCKER_COMPOSE pull $DOCKER_COMPOSE -p "$DOCKER_PROJECT_NAME" up -d ;; From 5e19a8f65811b93a7671a0520f766af99091059f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9as=20Hanss?= Date: Fri, 23 Jun 2017 10:16:37 +0200 Subject: [PATCH 6/7] Make graylog as optionnal dependency --- docker-compose-dev-graylog-template.yml | 173 ++++++++++++++++++++++++ docker-compose-dev-template.yml | 32 ----- 2 files changed, 173 insertions(+), 32 deletions(-) create mode 100644 docker-compose-dev-graylog-template.yml diff --git a/docker-compose-dev-graylog-template.yml b/docker-compose-dev-graylog-template.yml new file mode 100644 index 0000000..725928d --- /dev/null +++ b/docker-compose-dev-graylog-template.yml @@ -0,0 +1,173 @@ + +version: '2' +services: + web: + image: klabs/apache_${DOCKER_PHP_VERSION} + hostname: ${DOCKER_PROJECT_NAME}_web + container_name: web + ports: + - "82:82" + - "88:88" + volumes: + - ./config/apache/sites-available/001-dynamic-vhost-ez5.conf:/etc/apache2/sites-available/001-dynamic-vhost-ez5.conf + - ./config/apache/sites-available/002-dynamic-vhost-ezplatform.conf:/etc/apache2/sites-available/002-dynamic-vhost-ezplatform.conf + - ./config/apache/sites-available/003-dynamic-vhost-ez4.conf:/etc/apache2/sites-available/003-dynamic-vhost-ez4.conf + - ./config/apache/sites-available/ez5-common.conf:/etc/apache2/sites-available/ez5-common.conf + - ./config/apache/sites-available/ezplatform-common.conf:/etc/apache2/sites-available/ezplatform-common.conf + - ./logs/apache/:/var/log/apache2 + - "./config/apache/php5/custom_vars.ini:$DOCKER_PHP_CONF_PATH/apache2/conf.d/custom_vars.ini" + - "./config/apache/php5/timezone.ini:$DOCKER_PHP_CONF_PATH/apache2/conf.d/timezone.ini" + - "$DOCKER_WWW_ROOT:$DOCKER_WWW_DEST" + - "$DOCKER_STORAGE_LOCAL_PATH:$DOCKER_STORAGE_MOUNT_POINT" + env_file: + - docker-compose.env + - docker-compose.env.local + cap_add: + - SYS_PTRACE + cli: + image: klabs/cli_${DOCKER_PHP_VERSION} + hostname: ${DOCKER_PROJECT_NAME}_cli + container_name: cli + privileged: true + volumes: + - ./logs/cli:/var/log/php + # files in /tmp/cron.d get managed by bootstrap.sh + - ./config/cli/cron.d:/tmp/cron.d + - ~/.gitconfig:/home/site/.gitconfig + - ~/.ssh/config:/home/site/.ssh/config + - "$SSH_AUTH_SOCK:/ssh-agent" + - "./config/cli/php5/custom_vars.ini:$DOCKER_PHP_CONF_PATH/cli/conf.d/custom_vars.ini" + - "./config/cli/php5/timezone.ini:$DOCKER_PHP_CONF_PATH/cli/conf.d/timezone.ini" + - "$DOCKER_WWW_ROOT:$DOCKER_WWW_DEST" + - "$DOCKER_STORAGE_LOCAL_PATH:$DOCKER_STORAGE_MOUNT_POINT" + environment: + - SSH_AUTH_SOCK=/ssh-agent + env_file: + - docker-compose.env + - docker-compose.env.local + cap_add: + - SYS_PTRACE + memcached: + image: klabs/memcached + hostname: ${DOCKER_PROJECT_NAME}_memcached + container_name: memcached + ports: + - "11211:11211" + volumes: + - ./logs/memcache/:/var/log/memcache + env_file: + - docker-compose.env + - docker-compose.env.local + cap_add: + - SYS_PTRACE + solr: + image: klabs/solr4 + hostname: ${DOCKER_PROJECT_NAME}_solr + container_name: solr + ports: + - "8983:8983" + volumes: + - "${DOCKER_SOLR_CONF_PATH}:/opt/solr/solr/" + - ./data/solr/:/opt/solr/data/ + - ./logs/solr/:/opt/solr/logs + env_file: + - docker-compose.env + - docker-compose.env.local + cap_add: + - SYS_PTRACE + varnish: + image: klabs/varnish + hostname: ${DOCKER_PROJECT_NAME}_varnish + container_name: varnish + ports: + - "81:81" + volumes: + - "${DOCKER_VARNISH_VCL_FILE}:/etc/varnish/default.vcl" + - ./logs/varnish/:/var/log/varnish + env_file: + - docker-compose.env + - docker-compose.env.local + cap_add: + - SYS_PTRACE + # varnish init daemon wants to set ulimits + - SYS_RESOURCE + security_opt: + - apparmor:unconfined + depends_on: + - web + - cli + haproxy: + image: klabs/haproxy + hostname: ${DOCKER_PROJECT_NAME}_haproxy + container_name: haproxy + ports: + - "80:80" + volumes: + - ./config/haproxy/haproxy.cfg:/etc/haproxy/haproxy.cfg + env_file: + - docker-compose.env + - docker-compose.env.local + depends_on: + - web + - varnish + - solr + mysql: + image: klabs/mysql + hostname: ${DOCKER_PROJECT_NAME}_mysql + container_name: mysql + # nb: this prevents the image to start on some ubuntu installs because of apparmor config... + #privileged: true + ports: + - "3307:3306" + volumes: + - ./config/mysql/:/etc/mysql/conf.d/ + - ./data/mysql/:/var/lib/mysql + - ./logs/mysql/:/var/log/mysql + env_file: + - docker-compose.env + - docker-compose.env.local + cap_add: + - SYS_PTRACE + command: ["/root/bootstrap.sh", "mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci"] + + # official phpmyadmin image + phpmyadmin: + image: phpmyadmin/phpmyadmin + hostname: ${DOCKER_PROJECT_NAME}_phpmyadmin + container_name: phpmyadmin + env_file: + - docker-compose.env + - docker-compose.env.local + depends_on: + - mysql + # Graylog stack + mongo: + container_name: graylog-mongo + image: "mongo:3" + volumes: + - ./config/graylog:/docker-entrypoint-initdb.d + elasticsearch: + container_name: graylog-elastic + image: "elasticsearch:2" + command: "elasticsearch -Des.cluster.name='graylog'" + graylog: + container_name: graylog-server + image: 'graylog2/server:latest' + environment: + GRAYLOG_PASSWORD_SECRET: somepasswordpepper + GRAYLOG_ROOT_PASSWORD_SHA2: 8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918 + GRAYLOG_WEB_ENDPOINT_URI: http://127.0.0.1:9000/api + depends_on: + - mongo + - elasticsearch + ports: + - "9000:9000" + filebeats: + container_name: graylog-filebeat + #image: TODO_ON_DOCKERHUB_UPLOAD + build: ./images/filebeat + depends_on: + - graylog + volumes: + - ./config/graylog/filebeat:/mnt + - ./logs:/app-logs diff --git a/docker-compose-dev-template.yml b/docker-compose-dev-template.yml index 274418a..87fa7b0 100644 --- a/docker-compose-dev-template.yml +++ b/docker-compose-dev-template.yml @@ -153,35 +153,3 @@ services: - docker-compose.env.local depends_on: - mysql - - # Graylog stack - mongo: - container_name: graylog-mongo - image: "mongo:3" - volumes: - - ./config/graylog:/docker-entrypoint-initdb.d - elasticsearch: - container_name: graylog-elastic - image: "elasticsearch:2" - command: "elasticsearch -Des.cluster.name='graylog'" - graylog: - container_name: graylog-server - image: 'graylog2/server:latest' - environment: - GRAYLOG_PASSWORD_SECRET: somepasswordpepper - GRAYLOG_ROOT_PASSWORD_SHA2: 8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918 - GRAYLOG_WEB_ENDPOINT_URI: http://127.0.0.1:9000/api - depends_on: - - mongo - - elasticsearch - ports: - - "9000:9000" - filebeats: - container_name: graylog-filebeat - #image: TODO_ON_DOCKERHUB_UPLOAD - build: ./images/filebeat - depends_on: - - graylog - volumes: - - ./config/graylog/filebeat:/mnt - - ./logs:/app-logs From 64d28df48baa4271ca0d7ae912002eb9b8c542f3 Mon Sep 17 00:00:00 2001 From: Steven Bressey Date: Tue, 27 Jun 2017 09:00:35 +0200 Subject: [PATCH 7/7] added graylog include file --- graylog.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 graylog.yml diff --git a/graylog.yml b/graylog.yml new file mode 100644 index 0000000..ce641f8 --- /dev/null +++ b/graylog.yml @@ -0,0 +1,36 @@ +# Graylog stack +version: '2' +services: + mongo: + container_name: graylog-mongo + image: "mongo:3" + volumes: + - ./config/graylog:/docker-entrypoint-initdb.d + + elasticsearch: + container_name: graylog-elastic + image: "elasticsearch:2" + command: "elasticsearch -Des.cluster.name='graylog'" + + graylog: + container_name: graylog-server + image: 'graylog2/server:latest' + environment: + GRAYLOG_PASSWORD_SECRET: somepasswordpepper + GRAYLOG_ROOT_PASSWORD_SHA2: 8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918 + GRAYLOG_WEB_ENDPOINT_URI: http://127.0.0.1:9000/api + depends_on: + - mongo + - elasticsearch + ports: + - "9000:9000" + + filebeats: + container_name: graylog-filebeat + #image: TODO_ON_DOCKERHUB_UPLOAD + build: ./images/filebeat + depends_on: + - graylog + volumes: + - ./config/graylog/filebeat:/mnt + - ./logs:/app-logs \ No newline at end of file