Skip to content

Commit 0919fd7

Browse files
Merge pull request #156 from AI-Syndicate-1947/dsp-haproxy-3.2.4
Updated the underlying haproxy version from 2.2 to 3.2.4
2 parents 2712f13 + 210c1f8 commit 0919fd7

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM haproxy:2.2-alpine
1+
FROM haproxy:3.2.4-alpine
22

33
EXPOSE 2375
44
ENV ALLOW_RESTARTS=0 \
@@ -33,3 +33,5 @@ ENV ALLOW_RESTARTS=0 \
3333
VOLUMES=0
3434
COPY docker-entrypoint.sh /usr/local/bin/
3535
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg.template
36+
USER root
37+
CMD ["haproxy", "-f", "/tmp/haproxy.cfg"]

docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ case "$DISABLE_IPV6_LOWER" in
1515
esac
1616

1717
# Process the HAProxy configuration template using sed
18-
sed "s/\${BIND_CONFIG}/$BIND_CONFIG/g" /usr/local/etc/haproxy/haproxy.cfg.template > /usr/local/etc/haproxy/haproxy.cfg
18+
sed "s/\${BIND_CONFIG}/$BIND_CONFIG/g" /usr/local/etc/haproxy/haproxy.cfg.template > /tmp/haproxy.cfg
1919

2020
# first arg is `-f` or `--some-option`
2121
if [ "${1#-}" != "$1" ]; then

haproxy.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ backend docker-events
4646
frontend dockerfrontend
4747
bind ${BIND_CONFIG}
4848
http-request deny unless METH_GET || { env(POST) -m bool }
49+
50+
# Allowed endpoints
4951
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/((stop)|(restart)|(kill)) } { env(ALLOW_RESTARTS) -m bool }
5052
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/start } { env(ALLOW_START) -m bool }
5153
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/stop } { env(ALLOW_STOP) -m bool }

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[tool.poetry]
22
name = "docker-socket-proxy"
3-
version = "0.0.0"
3+
version = "1.0.0"
44
description = ""
55
authors = ["Tecnativa"]
6+
package-mode = false
67

78
[tool.poetry.dependencies]
89
python = "^3.8"

0 commit comments

Comments
 (0)