@@ -5,10 +5,10 @@ This is a basic haproxy image that can be used as a front end to a container. It
5
5
hence the choices of components and configuration. Mounting the container /conf directory to the local host is
6
6
required for configuring the server certificate but it also allows a
7
7
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
10
10
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)
12
12
13
13
The default haproxy container is linked with the backend container at startup and uses the Docker internal networking.
14
14
Therefore, no ports need to be exposed on the backend container.
@@ -19,13 +19,21 @@ container /logs directory.
19
19
Note: This container cannot handle multiple backend containers/services.
20
20
21
21
## building it
22
+ ```
22
23
docker build -t cadc-haproxy-dev -f Dockerfile .
24
+ ```
23
25
24
26
## checking it
27
+ ```
25
28
docker run --rm -it cadc-haproxy-dev:latest /bin/bash
29
+ ```
26
30
27
31
## 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).
29
37
30
38
## test some functionality with the configuration in /test that uses httpbin.org as a backend
31
39
curl -E <user-cert > https://<host >/headers
0 commit comments