Skip to content

Commit 1e987be

Browse files
committed
cadc-haproxy-dev: change conf to config for consistency
1 parent e3c6ef8 commit 1e987be

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

cadc-haproxy-dev/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM centos:7
22

3-
RUN yum -y update && yum install -y haproxy && yum install -y rsyslog && yum clean all
3+
RUN yum -y update && yum install -y haproxy rsyslog && yum clean all
44
ENV OPENSSL_ALLOW_PROXY_CERTS=1
55

66
# set up the configuration for rsyslog. haproxy requires it for logging

cadc-haproxy-dev/README.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ This is a basic haproxy image that can be used as a front end to a container. It
55
hence the choices of components and configuration. Mounting the container /conf directory to the local host is
66
required for configuring the server certificate but it also allows a
77
number of features to be customized:
8-
1. /conf/server-cert.pem is the server certificate (required)
9-
2. /conf/cacerts is a directory containing CA certificates that should be added to the CA bundle if not part of
8+
1. /config/server-cert.pem is the server certificate (required)
9+
2. /config/cacerts is a directory containing CA certificates that should be added to the CA bundle if not part of
1010
the default bundle (optional)
11-
3. /conf/haproxy.cfg overrides the default haproxy configuration (optional)
11+
3. /config/haproxy.cfg overrides the default haproxy configuration (optional)
1212

1313
The default haproxy container is linked with the backend container at startup and uses the Docker internal networking.
1414
Therefore, no ports need to be exposed on the backend container.
@@ -19,13 +19,21 @@ container /logs directory.
1919
Note: This container cannot handle multiple backend containers/services.
2020

2121
## building it
22+
```
2223
docker build -t cadc-haproxy-dev -f Dockerfile .
24+
```
2325

2426
## checking it
27+
```
2528
docker run --rm -it cadc-haproxy-dev:latest /bin/bash
29+
```
2630

2731
## running it with another container as back end: "backend-container-name"
28-
docker run --rm -v <path-to-external-logs>:/logs:rw <path-to-server-cert>:/conf:ro -p 443:443 --link <backend-container-name>:cadc-service --name haproxy cadc-haproxy-dev:latest
32+
```
33+
docker run --rm --volume=<path-to-external-logs>:/logs:rw --volume=<path-to-server-cert>:/config:ro -p 443:443 --name haproxy cadc-haproxy-dev:latest
34+
```
35+
Other options like `--link <backend-container-name>:cadc-service` could be used with the default haproxy.cfg to
36+
have haproxy forward requests to a single back end container (e.g. for testing).
2937

3038
## test some functionality with the configuration in /test that uses httpbin.org as a backend
3139
curl -E <user-cert> https://<host>/headers

cadc-haproxy-dev/src/entrypoint

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ trap "echo 'ERROR running/starting haproxy'; exit -1" ERR
66
# log to external
77
LOGDIR=/logs
88
LOG=$LOGDIR/haproxy.log
9-
CONFDIR=/conf
9+
CONFDIR=/config
1010

1111
touch $LOG
1212

@@ -32,7 +32,7 @@ fi
3232

3333
if [ -e $CONFDIR/haproxy.cfg ]; then
3434
cp $CONFDIR/haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
35-
echo "Using custom haproxy.conf found in $CONFDIR" >> $LOG
35+
echo "Using custom haproxy.cfg found in $CONFDIR" >> $LOG
3636
fi
3737

3838
update-ca-trust

cadc-haproxy-dev/src/haproxy/haproxy.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ defaults
1919

2020
frontend https-in
2121
log global
22-
bind *:443 ssl crt /conf/server-cert.pem ca-file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem verify optional
22+
bind *:443 ssl crt /config/server-cert.pem ca-file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem verify optional
2323
mode http
2424
option forwardfor
2525
option http-server-close

0 commit comments

Comments
 (0)