Skip to content

Commit 30a8a92

Browse files
authored
Switch default docker-compose to PostgreSQL+Elasticsearch (#41)
1 parent 5d7d242 commit 30a8a92

6 files changed

+124
-28
lines changed

README.md

+17-12
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ Every major or minor release of the Temporal Server has a corresponding docker-c
77
## Prerequisites
88

99
To use these files, you must first have the following installed:
10-
* [Docker](https://docs.docker.com/engine/installation/)
11-
* [docker-compose](https://docs.docker.com/compose/install/)
10+
11+
- [Docker](https://docs.docker.com/engine/installation/)
12+
- [docker-compose](https://docs.docker.com/compose/install/)
1213

1314
## How to use
1415

@@ -34,15 +35,18 @@ alias tctl="docker exec temporal-admin-tools tctl"
3435
```
3536

3637
The following is an example of how to register a new namespace `test-namespace` with 1 day of retention:
38+
3739
```bash
3840
tctl --ns test-namespace namespace register -rd 1
3941
```
4042

43+
You can find our `tctl` docs on [docs.temporal.io](https://docs.temporal.io/docs/system-tools/tctl/).
44+
4145
Get started building Workflows with a [Go sample](https://github.com/temporalio/samples-go), [Java sample](https://github.com/temporalio/samples-java), or write your own using one of the [SDKs](https://docs.temporal.io/docs/sdks-introduction).
4246

4347
### Other configuration files
4448

45-
The default configuration file (`docker-compose.yml`) uses a Cassandra database and exposes the Temporal gRPC Frontend on port 7233.
49+
The default configuration file (`docker-compose.yml`) uses a PostgreSQL database, an Elasticsearch instance, and exposes the Temporal gRPC Frontend on port 7233.
4650
The other configuration files in the repo spin up instances of the Temporal Server using different databases and dependencies.
4751
For example you can run the Temporal Server with MySQL and Elastic Search with this command:
4852

@@ -52,15 +56,16 @@ docker-compose -f docker-compose-mysql-es.yml up
5256

5357
Here is a list of available files and the dependencies they use.
5458

55-
| File | Description |
56-
|---------------------------------|-------------|
57-
| docker-compose.yml | Cassandra (default) |
58-
| docker-compose-cas-es.yml | Cassandra and Elasticsearch |
59-
| docker-compose-mysql.yml | MySQL |
60-
| docker-compose-mysql-es.yml | MySQL and Elasticsearch |
61-
| docker-compose-postgres.yml | PostgreSQL |
62-
| docker-compose-cockroach.yml | CockroachDB |
63-
| docker-compose-cockroach-es.yml | CockroachDB and Elasticsearch |
59+
| File | Description |
60+
| ------------------------------- | -------------------------------------- |
61+
| docker-compose.yml | PostgreSQL and Elasticsearch (default) |
62+
| docker-compose-postgres.yml | PostgreSQL |
63+
| docker-compose-cas.yml | Cassandra |
64+
| docker-compose-cas-es.yml | Cassandra and Elasticsearch |
65+
| docker-compose-mysql.yml | MySQL |
66+
| docker-compose-mysql-es.yml | MySQL and Elasticsearch |
67+
| docker-compose-cockroach.yml | CockroachDB |
68+
| docker-compose-cockroach-es.yml | CockroachDB and Elasticsearch |
6469

6570
### Use a custom image configuration
6671

docker-compose-cas-es.yml

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ services:
1010
elasticsearch:
1111
container_name: temporal-elasticsearch
1212
environment:
13+
# Set storage limit to low number.
14+
- cluster.routing.allocation.disk.threshold_enabled=true
15+
- cluster.routing.allocation.disk.watermark.low=512mb
16+
- cluster.routing.allocation.disk.watermark.high=256mb
17+
- cluster.routing.allocation.disk.watermark.flood_stage=128mb
1318
- discovery.type=single-node
1419
- ES_JAVA_OPTS=-Xms100m -Xmx100m
1520
image: elasticsearch:7.10.1

docker-compose-cas.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
version: "3.5"
2+
services:
3+
cassandra:
4+
container_name: temporal-cassandra
5+
image: cassandra:3.11.9
6+
networks:
7+
- temporal-network
8+
ports:
9+
- 9042:9042
10+
temporal:
11+
container_name: temporal
12+
depends_on:
13+
- cassandra
14+
environment:
15+
- CASSANDRA_SEEDS=cassandra
16+
- DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml
17+
image: temporalio/auto-setup:1.11.3
18+
networks:
19+
- temporal-network
20+
ports:
21+
- 7233:7233
22+
volumes:
23+
- ./dynamicconfig:/etc/temporal/config/dynamicconfig
24+
temporal-admin-tools:
25+
container_name: temporal-admin-tools
26+
depends_on:
27+
- temporal
28+
environment:
29+
- TEMPORAL_CLI_ADDRESS=temporal:7233
30+
image: temporalio/admin-tools:1.11.3
31+
networks:
32+
- temporal-network
33+
stdin_open: true
34+
tty: true
35+
temporal-web:
36+
container_name: temporal-web
37+
depends_on:
38+
- temporal
39+
environment:
40+
- TEMPORAL_GRPC_ENDPOINT=temporal:7233
41+
- TEMPORAL_PERMIT_WRITE_API=true
42+
image: temporalio/web:1.11.0
43+
networks:
44+
- temporal-network
45+
ports:
46+
- 8088:8088
47+
networks:
48+
temporal-network:
49+
driver: bridge
50+
name: temporal-network

docker-compose-cockroach-es.yml

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ services:
1818
elasticsearch:
1919
container_name: temporal-elasticsearch
2020
environment:
21+
# Set storage limit to low number.
22+
- cluster.routing.allocation.disk.threshold_enabled=true
23+
- cluster.routing.allocation.disk.watermark.low=512mb
24+
- cluster.routing.allocation.disk.watermark.high=256mb
25+
- cluster.routing.allocation.disk.watermark.flood_stage=128mb
2126
- discovery.type=single-node
2227
- ES_JAVA_OPTS=-Xms100m -Xmx100m
2328
image: elasticsearch:7.10.1

docker-compose-mysql-es.yml

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
version: "3.5"
22
services:
3+
mysql:
4+
container_name: temporal-mysql
5+
environment:
6+
- MYSQL_ROOT_PASSWORD=root
7+
image: mysql:5.7
8+
networks:
9+
- temporal-network
10+
ports:
11+
- 3306:3306
312
elasticsearch:
413
container_name: temporal-elasticsearch
514
environment:
15+
# Set storage limit to low number.
16+
- cluster.routing.allocation.disk.threshold_enabled=true
17+
- cluster.routing.allocation.disk.watermark.low=512mb
18+
- cluster.routing.allocation.disk.watermark.high=256mb
19+
- cluster.routing.allocation.disk.watermark.flood_stage=128mb
620
- discovery.type=single-node
721
- ES_JAVA_OPTS=-Xms100m -Xmx100m
822
image: elasticsearch:7.10.1
923
networks:
1024
- temporal-network
1125
ports:
1226
- 9200:9200
13-
mysql:
14-
container_name: temporal-mysql
15-
environment:
16-
- MYSQL_ROOT_PASSWORD=root
17-
image: mysql:5.7
18-
networks:
19-
- temporal-network
20-
ports:
21-
- 3306:3306
2227
temporal:
2328
container_name: temporal
2429
depends_on:

docker-compose.yml

+33-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,45 @@
11
version: "3.5"
22
services:
3-
cassandra:
4-
container_name: temporal-cassandra
5-
image: cassandra:3.11.9
3+
postgresql:
4+
container_name: temporal-postgresql
5+
environment:
6+
POSTGRES_PASSWORD: temporal
7+
POSTGRES_USER: temporal
8+
image: postgres:9.6
9+
networks:
10+
- temporal-network
11+
ports:
12+
- 5432:5432
13+
elasticsearch:
14+
container_name: temporal-elasticsearch
15+
environment:
16+
# Set storage limit to low number.
17+
- cluster.routing.allocation.disk.threshold_enabled=true
18+
- cluster.routing.allocation.disk.watermark.low=512mb
19+
- cluster.routing.allocation.disk.watermark.high=256mb
20+
- cluster.routing.allocation.disk.watermark.flood_stage=128mb
21+
- discovery.type=single-node
22+
- ES_JAVA_OPTS=-Xms100m -Xmx100m
23+
image: elasticsearch:7.10.1
624
networks:
725
- temporal-network
826
ports:
9-
- 9042:9042
27+
- 9200:9200
1028
temporal:
1129
container_name: temporal
1230
depends_on:
13-
- cassandra
31+
- postgresql
32+
- elasticsearch
1433
environment:
15-
- CASSANDRA_SEEDS=cassandra
16-
- DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml
34+
- DB=postgresql
35+
- DB_PORT=5432
36+
- POSTGRES_USER=temporal
37+
- POSTGRES_PWD=temporal
38+
- POSTGRES_SEEDS=postgresql
39+
- DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development_es.yaml
40+
- ENABLE_ES=true
41+
- ES_SEEDS=elasticsearch
42+
- ES_VERSION=v7
1743
image: temporalio/auto-setup:1.11.3
1844
networks:
1945
- temporal-network

0 commit comments

Comments
 (0)