Skip to content
Snippets Groups Projects
Commit a32d2f43 authored by Pierre Ozoux's avatar Pierre Ozoux
Browse files

Uses official haproxy

parent 5840192a
No related branches found
No related tags found
No related merge requests found
FROM debian:jessie
ENV DEBIAN_FRONTEND noninteractive
# Install Haproxy.
RUN \
apt-get update && \
apt-get install -y \
haproxy \
rsyslog && \
rm -rf /var/lib/apt/lists/*
ADD run.sh /run.sh
CMD ["/run.sh"]
EXPOSE 80
EXPOSE 443
# HAproxy
The smallest HAproxy docker image in town ;)
## Run
```bash
docker run\
-v /haproxy-config:/etc/haproxy\
-p 80:80\
-p 443:443\
indiepaas/haproxy
```
Have a look to [indiepaas/confd](https://registry.hub.docker.com/u/indiepaas/confd/) to have automatic configuration of HAproxy backed by `etcd` or `consul`.
#!/bin/bash -e
function cleanup {
/etc/init.d/haproxy stop
/etc/init.d/rsyslog stop
exit 0
}
# start haproxy in bg and tail logs out to stdout
/usr/sbin/service rsyslog start
/etc/init.d/haproxy start
tail -f /var/log/syslog &
tail -f /var/log/haproxy.log &
trap cleanup SIGTERM SIGINT
while true; do # Iterate to keep job running.
sleep 1 # Don't sleep too long as signals will not be handled during sleep.
done
......@@ -19,7 +19,7 @@ ExecStart=/usr/bin/docker run \
-v /data/runtime/haproxy:/etc/haproxy \
-p 80:80 \
-p 443:443 \
indiepaas/haproxy
haproxy haproxy -f /etc/haproxy/haproxy.cfg
ExecReload=/usr/bin/docker restart %p
ExecStop=/usr/bin/docker stop %p
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment