Skip to content

Commit a63e3d7

Browse files
authored
Merge branch 'main' into alex/spell
2 parents 398d8a6 + 793707d commit a63e3d7

File tree

3 files changed

+65
-94
lines changed

3 files changed

+65
-94
lines changed

compose/README.md

Lines changed: 52 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -7,70 +7,88 @@ There are a variety of docker-compose files, each utilizing a different set of d
77

88
To use these files, you must first have the following installed:
99

10-
- [Docker](https://docs.docker.com/engine/installation/)
11-
- [docker-compose](https://docs.docker.com/compose/install/)
10+
- [Docker](https://docs.docker.com/engine/install/) (includes Docker Compose)
1211

1312
## How to use
1413

1514
The following steps will run a local instance of the Temporal Server using the default configuration file (`docker-compose.yml`):
1615

1716
1. Clone this repository.
18-
2. Change directory into the root of the project.
19-
3. Run the `docker-compose up` command.
17+
2. Change directory into the `compose` folder.
18+
3. Run the `docker compose up` command.
2019

2120
```bash
2221
git clone https://github.com/temporalio/samples-server.git
2322
cd samples-server/compose
24-
docker-compose up
23+
docker compose up
2524
```
2625

27-
> ⚠️ If you are on an M1 Mac, note that Temporal v1.12 to v1.14 had fatal issues with ARM builds. v1.14.2 onwards should be fine for M1 Macs.
28-
2926
After the Server has started, you can open the Temporal Web UI in your browser: [http://localhost:8080](http://localhost:8080).
3027

31-
You can also interact with the Server using a preconfigured CLI (tctl).
32-
First create an alias for `tctl`:
28+
To stop and remove containers and volumes:
29+
30+
```bash
31+
docker compose down -v
32+
```
33+
34+
You can also interact with the Server using the [Temporal CLI](https://docs.temporal.io/cli).
35+
36+
To install the Temporal CLI:
3337

3438
```bash
35-
alias tctl="docker exec temporal-admin-tools tctl"
39+
# macOS (Homebrew)
40+
brew install temporal
41+
42+
# Other platforms - see https://docs.temporal.io/cli#install
3643
```
3744

38-
The following is an example of how to register a new namespace `test-namespace` with 1 day of retention:
45+
The following is an example of how to create a new namespace `test-namespace` with 1 day of retention:
3946

4047
```bash
41-
tctl --ns test-namespace namespace register -rd 1
48+
temporal operator namespace create --namespace test-namespace --retention 1d
4249
```
4350

44-
You can find our `tctl` docs on [docs.temporal.io](https://docs.temporal.io/docs/system-tools/tctl/).
51+
Get started building Workflows with the SDK samples:
52+
53+
- [Go](https://github.com/temporalio/samples-go)
54+
- [Java](https://github.com/temporalio/samples-java)
55+
- [Python](https://github.com/temporalio/samples-python)
56+
- [TypeScript](https://github.com/temporalio/samples-typescript)
57+
- [.NET](https://github.com/temporalio/samples-dotnet)
58+
- [PHP](https://github.com/temporalio/samples-php)
59+
- [Ruby](https://github.com/temporalio/samples-ruby)
4560

46-
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).
61+
For the most up-to-date SDK references, see [https://docs.temporal.io/develop](https://docs.temporal.io/develop).
4762

48-
### Other configuration files
63+
## Other configuration files
4964

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

5469
```bash
55-
docker-compose -f docker-compose-mysql-es.yml up
70+
docker compose -f docker-compose-mysql-es.yml up
5671
```
5772

5873
Here is a list of available files and the dependencies they use.
5974

60-
| File | Description |
61-
|----------------------------------------|---------------------------------------------------------------|
62-
| docker-compose.yml | PostgreSQL and Elasticsearch (default) |
63-
| docker-compose-tls.yml | PostgreSQL and Elasticsearch with TLS |
64-
| docker-compose-postgres.yml | PostgreSQL |
65-
| docker-compose-cass-es.yml | Cassandra and Elasticsearch |
66-
| docker-compose-mysql.yml | MySQL |
67-
| docker-compose-mysql-es.yml | MySQL and Elasticsearch |
68-
| docker-compose-postgres-opensearch.yml | PostgreSQL and OpenSearch |
69-
| docker-compose-multirole.yml | PostgreSQL and Elasticsearch with mult-role Server containers |
75+
| File | Description |
76+
|----------------------------------------|----------------------------------------------------------------|
77+
| docker-compose-dev.yml | Development server with local file storage (UI on port 8233) |
78+
| docker-compose.yml | PostgreSQL and Elasticsearch (default) |
79+
| docker-compose-tls.yml | PostgreSQL and Elasticsearch with TLS |
80+
| docker-compose-postgres.yml | PostgreSQL |
81+
| docker-compose-cass-es.yml | Cassandra and Elasticsearch |
82+
| docker-compose-mysql.yml | MySQL |
83+
| docker-compose-mysql-es.yml | MySQL and Elasticsearch |
84+
| docker-compose-postgres-opensearch.yml | PostgreSQL and OpenSearch |
85+
| docker-compose-multirole.yaml | PostgreSQL and Elasticsearch with multi-role Server containers |
7086

71-
### Using multi-role configuration
87+
## Using multi-role configuration
7288

73-
First install the loki plugin (this is one time operation)
89+
The `docker-compose-multirole.yaml` configuration runs each Temporal service separately and includes Prometheus and Grafana with [Server and SDK dashboards](https://github.com/temporalio/dashboards).
90+
91+
First install the Loki plugin (this is a one-time operation)
7492
```bash
7593
docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions
7694
```
@@ -87,73 +105,16 @@ Some exposed endpoints:
87105
- http://localhost:9090/targets - Prometheus targets
88106
- http://localhost:8000/metrics - Server metrics
89107

90-
### Using the web interface
91-
92-
`docker-compose.yml` includes the Temporal Web UI.
93-
94-
If you run command:
95-
96-
```bash
97-
docker-compose up
98-
```
99-
100-
You access the Temporal Web UI at http://localhost:8080.
101-
102-
### Enabling metrics (with Grafana and Prometheus)
103-
104-
We maintain two example docker-compose setups with server metrics enabled, and Prometheus and Grafana with [our Server and SDK dashboards](https://github.com/temporalio/dashboards):
105-
106-
- https://github.com/tsurdilo/my-temporal-dockercompose
107-
- https://github.com/temporalio/background-checks
108-
109-
### Use a custom image configuration
108+
## Production deployments
110109

111-
If you want, you can even use a custom Docker image of the Temporal Server.
110+
These docker-compose setups are intended for local development and testing. For production deployments:
112111

113-
Clone the main Temporal Server repo: [https://github.com/temporalio/temporal](https://github.com/temporalio/temporal):
114-
115-
```bash
116-
git clone https://github.com/temporalio/temporal.git
117-
```
118-
119-
In the following command, replace **<YOUR_TAG>** and **<YOUR_COMMIT>** to build the custom Docker image:
120-
121-
```bash
122-
git checkout <YOUR_COMMIT>
123-
docker build . -t temporalio/server:<YOUR_TAG> --build-arg TARGET=server
124-
```
125-
126-
Next, in the `docker-compose.yml` file, replace the `TEMPORAL_VERSION` value in the `.env` file with **<YOUR_TAG>**.
127-
128-
Then run the `docker-compose up` command:
129-
130-
```bash
131-
docker-compose up
132-
```
133-
134-
## Using Temporal docker images in production
135-
136-
These docker-compose setups use the `temporalio/server` image with a separate initialization step to set up database schemas. The `temporal-admin-tools` service runs once to create and initialize the database schema, then the `temporal` service starts using `temporalio/server`.
137-
138-
In a typical production setting, dependencies such as `cassandra` or `elasticsearch` are managed/started independently of the Temporal server, and schemas are set up as part of your deployment process rather than at startup.
139-
140-
To use the `temporalio/server` container in a production setting, use the following command:
141-
142-
```plain
143-
docker run -e CASSANDRA_SEEDS=10.x.x.x -- csv of Cassandra server ipaddrs
144-
-e KEYSPACE=<keyspace> -- Cassandra keyspace
145-
-e VISIBILITY_KEYSPACE=<visibility_keyspace> -- Cassandra visibility keyspace
146-
-e SKIP_SCHEMA_SETUP=true -- do not setup Cassandra schema during startup
147-
-e NUM_HISTORY_SHARDS=1024 \ -- Number of history shards
148-
-e SERVICES=history,matching \ -- Spin-up only the provided services
149-
-e LOG_LEVEL=debug,info \ -- Logging level
150-
-e DYNAMIC_CONFIG_FILE_PATH=config/foo.yaml -- Dynamic config file to be watched
151-
temporalio/server:<tag>
152-
```
112+
- **Kubernetes**: Use the [Temporal Helm Charts](https://github.com/temporalio/helm-charts) repository
113+
- **Schema setup**: Reference the [setup scripts](./scripts/) in this repository for database schema initialization examples
153114

154115
## Server Configuration Templates
155116

156-
The Temporal Server uses a base configuration template that defines the structure for persistence, visibility, and other settings.
117+
The Temporal Server uses a base configuration template that defines the structure for persistence, visibility, and other settings. These templates use [Sprig](https://masterminds.github.io/sprig/) for templating, which provides functions for string manipulation, environment variable access, and more.
157118

158119
### Configuration template location by version
159120

@@ -177,4 +138,3 @@ The docker-compose files in this repository work with both pre-v1.30 and v1.30+
177138
3. **Schema management**: Setup scripts detect and use new tools when available, with fallback to legacy methods
178139

179140
For customizing server configuration beyond environment variables, refer to the appropriate template file for your server version.
180-

compose/docker-compose-dev.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
temporal:
3+
image: temporalio/temporal:latest
4+
container_name: temporal
5+
ports:
6+
- 7233:7233
7+
- 8233:8233
8+
volumes:
9+
- temporal-data:/data
10+
command: server start-dev --ip 0.0.0.0 --db-filename /data/temporal.db
11+
12+
volumes:
13+
temporal-data:

compose/docker-compose-multirole.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,6 @@ services:
372372
target: 13133
373373
- published: 4317
374374
target: 4317
375-
- published: 55670
376-
target: 55670
377375
depends_on:
378376
- jaeger-all-in-one
379377
networks:

0 commit comments

Comments
 (0)