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

Update HAProxy #70

Open
wants to merge 3 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
10 changes: 9 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM haproxy:2.2-alpine
FROM haproxy:lts-alpine

RealOrangeOne marked this conversation as resolved.
Show resolved Hide resolved
USER root

EXPOSE 2375
ENV ALLOW_RESTARTS=0 \
Expand Down Expand Up @@ -28,4 +30,10 @@ ENV ALLOW_RESTARTS=0 \
TASKS=0 \
VERSION=1 \
VOLUMES=0

COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT [ "/docker-entrypoint.sh" ]

COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg

CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]
10 changes: 10 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

set -e

# Create a group with the same gid as the docker socket
export DOCKER_GID=$(stat -c "%g" $SOCKET_PATH)
addgroup -g $DOCKER_GID docker

# Run the original entrypoint - Our work here is done.
exec /usr/local/bin/docker-entrypoint.sh $@
3 changes: 3 additions & 0 deletions haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ global
pidfile /run/haproxy.pid
maxconn 4000

user haproxy
group docker

# Turn on stats unix socket
server-state-file /var/lib/haproxy/server-state

Expand Down