Skip to content

Commit 7cee33c

Browse files
jbreidingdnr
andauthored
allow .pki folder to exist and use single script for 0 to hero. (#88)
* allow .pki folder to exist and use single script for 0 to hero. * Update tls/run-tls.sh Co-authored-by: David Reiss <[email protected]> Co-authored-by: David Reiss <[email protected]>
1 parent 9938415 commit 7cee33c

File tree

4 files changed

+39
-12
lines changed

4 files changed

+39
-12
lines changed

docker-compose-tls.yml

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ services:
2626
- 9200
2727
volumes:
2828
- temporal_tls_pki:/usr/share/elasticsearch/config/certs
29+
restart: on-failure
2930
postgresql:
3031
container_name: temporal-postgresql
3132
command:
@@ -47,6 +48,7 @@ services:
4748
- 5432
4849
volumes:
4950
- temporal_tls_pki:/pki
51+
restart: on-failure
5052
temporal:
5153
container_name: temporal
5254
build:
@@ -78,6 +80,7 @@ services:
7880
- 7233:7233
7981
volumes:
8082
- ./dynamicconfig:/etc/temporal/config/dynamicconfig
83+
restart: on-failure
8184
temporal-admin-tools:
8285
container_name: temporal-admin-tools
8386
depends_on:
@@ -106,6 +109,7 @@ services:
106109
- temporal-network
107110
ports:
108111
- 8080:8080
112+
restart: on-failure
109113
networks:
110114
temporal-network:
111115
driver: bridge

tls/README.md

+19-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
# Temporal with tls enabled dependencies
22

3-
## Setup
3+
## Execute
44

55
run from a shell
66

7-
`./tls/make-certs.sh`
7+
`./tls/run-tls.sh`
88

9-
## Startup
9+
## Script source with comments
10+
```bash
11+
#!/usr/bin/env bash
12+
set -xe
1013

11-
run from a shell
14+
# Build container image for generating cert material
15+
docker build -t temporal_tls:test -f ${PWD}/tls/Dockerfile.tls .
16+
mkdir -p .pki
17+
18+
# Run container to name volume and copy out CA certificate
19+
docker run --rm -v temporal_tls_pki:/pki -v ${PWD}/.pki:/pki-out temporal_tls:test
20+
21+
# Build extra layers which copy in CA certificate to local trust store
22+
# Allows for not having to disable host verification on TLS connections
23+
COMPOSE_PROJECT_NAME=tls_test docker-compose -f docker-compose-tls.yml build --no-cache
1224

13-
`COMPOSE_PROJECT_NAME=tls_test docker-compose -f docker-compose-tls.yml build --no-cache`
25+
# Run example docker-compose environment with elasticsearch and postgresql protected with TLS
26+
COMPOSE_PROJECT_NAME=tls_test docker-compose -f docker-compose-tls.yml up
1427

15-
`COMPOSE_PROJECT_NAME=tls_test docker-compose -f docker-compose-tls.yml up`
28+
```

tls/make-certs.sh

-6
This file was deleted.

tls/run-tls.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
set -xe
3+
4+
# Build container image for generating cert material
5+
docker build -t temporal_tls:test -f ${PWD}/tls/Dockerfile.tls .
6+
mkdir -p .pki
7+
8+
# Run container to name volume and copy out CA certificate
9+
docker run --rm -v temporal_tls_pki:/pki -v ${PWD}/.pki:/pki-out temporal_tls:test
10+
11+
# Build extra layers which copy in CA certificate to local trust store
12+
# Allows for not having to disable host verification on TLS connections
13+
COMPOSE_PROJECT_NAME=tls_test docker-compose -f docker-compose-tls.yml build --no-cache
14+
15+
# Run example docker-compose environment with elasticsearch and postgresql protected with TLS
16+
COMPOSE_PROJECT_NAME=tls_test docker-compose -f docker-compose-tls.yml up

0 commit comments

Comments
 (0)