smebberson / docker-alpine

Docker containers running Alpine Linux and s6 for process management. Solid, reliable containers.
MIT License
596 stars 186 forks source link

Add alpine-consul-apache #9

Closed matthewvalimaki closed 8 years ago

matthewvalimaki commented 8 years ago

Copy of alpine-consul-nginx and does what the name implies.

"script": "wget -s http://localhost:80 > /dev/null 2>&1 || exit 2"

hits default index.html that is provided with the apache2 apk. I opted not to add a vhost for /ping as this was readily available and adding /ping is not as simple as with nginx.

smebberson commented 8 years ago

@matthewvalimaki, this is a great addition also! I've made some notes. Are you happy to go through and make the recommended changes?

matthewvalimaki commented 8 years ago

All notes made sense and were incorporated. Let me know if you want me to clean it up.

smebberson commented 8 years ago

@matthewvalimaki, I just pulled this down and ran everything. It's working great. Just wanted to consider something and get your thoughts.

With the nginx version of this, I created the route /ping and the nginx config, I've silenced that url so that it doesn't pollute the logs (or stdout).

This one is doing just that. Every time the consul health check takes place it's dumping the following to stdout:

127.0.0.1 - - [30/Nov/2015:02:06:20 +0000] "GET / HTTP/1.1" 200 263 "-" "Wget"

Do you think it's worth going to the trouble of creating a ping.local virtual host something, and silencing those logs? Then the consul health check would use that domain.

In real life, how are you extending this image?

matthewvalimaki commented 8 years ago

@smebberson I've updated the setup a bit: I removed logging to /dev/stdout per your comments. I've also added env=!dontlog and /etc/apache2/conf.d/ping.conf to hide GET / from logs. No vhost used but does modify the default CustomLog (access log) behavior by adding directive !dontlog.

Let me know what you think of this instead of vhost.

matthewvalimaki commented 8 years ago

@smebberson forgot to answer your question

In real life, how are you extending this image?

For now I am simply extending it with PHP and mounting volumes from data only containers.

smebberson commented 8 years ago

@matthewvalimaki. This has all been merged. Images are now available on Docker Hub. Thanks for this contribution! I changed a few things, and updated the documentation. Take a look at the last few commits to see what I changed (I hope you don't mind the change to alpine-consul-apache health checks, the configuration the way it was, was stopping all Apache access logs, not just those that hit the ping route).

Welcome aboard as the second biggest contributor to the project! https://github.com/smebberson/docker-alpine/graphs/contributors

matthewvalimaki commented 8 years ago

@smebberson I don't mind at all! What matters is getting the image up. The changes are good by the way. Oh duh, yeah. The configuration for dontlog was horrible, now when I stop to think about it.

Thank you for these images :)