Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP:Update docker-entrypoint.sh #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM haproxy:latest
MAINTAINER RafPe

RUN apt-get update && apt-get install rsyslog -y && \
RUN apt-get update && apt-get install rsyslog wget -y && \
sed -i 's/#$ModLoad imudp/$ModLoad imudp/g' /etc/rsyslog.conf && \
sed -i 's/#$UDPServerRun 514/$UDPServerRun 514/g' /etc/rsyslog.conf

RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64
RUN chmod +x /usr/local/bin/dumb-init

ADD haproxy.conf /etc/rsyslog.d
COPY docker-entrypoint.sh /

Expand All @@ -19,4 +22,5 @@ LABEL org.label-schema.build-date="2016-06-20T10:23:04Z" \

EXPOSE 80 443

ENTRYPOINT ["/docker-entrypoint.sh"]
ENTRYPOINT ["/usr/local/bin/dumb-init"]
CMD ["/docker-entrypoint.sh"]
13 changes: 9 additions & 4 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
#!/bin/sh

# Make sure service is running
service rsyslog start
set -e

# Touch the log file so we can tail on it
#Make the log file & change log file permission
touch /var/log/haproxy.log
chmod 644 /var/log/haproxy.log

# Make sure service is running
service rsyslog start

# Throw the log to output
tail -f /var/log/haproxy.log &

# Start haproxy
exec haproxy -f /usr/local/etc/haproxy/haproxy.cfg
exec haproxy -f /usr/local/etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid