-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
125 lines (125 loc) · 4.07 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
125 lines (125 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Local Temporal dev stack for the example walkthrough. Follows the layout of
# temporalio/samples-server compose: the temporalio/auto-setup image is no
# longer the recommended path, so schema setup and namespace creation run as
# one-shot admin-tools jobs against a plain temporalio/server container.
services:
postgresql:
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-temporal}
POSTGRES_USER: ${POSTGRES_USER:-temporal}
image: postgres:${POSTGRESQL_VERSION:-13}
networks:
- temporal-network
ports:
- ${POSTGRES_HOST_PORT:-5433}:5432
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U temporal"]
interval: 5s
timeout: 5s
retries: 60
start_period: 30s
# One-shot job: creates the temporal and temporal_visibility databases and
# applies the schemas, then exits. The server only starts once it succeeded.
temporal-admin-tools-setup:
restart: on-failure:6
depends_on:
postgresql:
condition: service_healthy
environment:
- DB=postgres12
- DB_PORT=5432
- POSTGRES_USER=temporal
- POSTGRES_PWD=temporal
- POSTGRES_SEEDS=postgresql
- SQL_PASSWORD=temporal
image: temporalio/admin-tools:${TEMPORAL_ADMINTOOLS_VERSION:-1.31.0}
networks:
- temporal-network
volumes:
- ./scripts:/scripts
entrypoint: ["/bin/sh"]
command: /scripts/setup-postgres.sh
temporal:
depends_on:
temporal-admin-tools-setup:
condition: service_completed_successfully
environment:
- DB=postgres12
- DB_PORT=5432
- POSTGRES_USER=temporal
- POSTGRES_PWD=temporal
- POSTGRES_SEEDS=postgresql
- BIND_ON_IP=0.0.0.0
- DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development-sql.yaml
image: temporalio/server:${TEMPORAL_VERSION:-1.31.0}
volumes:
- ./dynamicconfig:/etc/temporal/config/dynamicconfig
networks:
- temporal-network
ports:
- ${TEMPORAL_HOST_PORT:-7233}:7233
restart: on-failure
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "7233"]
interval: 5s
timeout: 3s
start_period: 30s
retries: 60
# One-shot job: waits for the server to be healthy and makes sure the
# default namespace exists.
temporal-create-namespace:
restart: on-failure:5
depends_on:
temporal:
condition: service_healthy
environment:
- DEFAULT_NAMESPACE=default
- DEFAULT_NAMESPACE_RETENTION=72h
- "TEMPORAL_ADDRESS=temporal:7233"
image: temporalio/admin-tools:${TEMPORAL_ADMINTOOLS_VERSION:-1.31.0}
volumes:
- ./scripts:/scripts
networks:
- temporal-network
entrypoint: ["/bin/sh"]
command: /scripts/create-namespace.sh
# Interactive admin-tools container: docker compose exec temporal-admin-tools bash
temporal-admin-tools:
depends_on:
temporal:
condition: service_healthy
environment:
- "TEMPORAL_ADDRESS=temporal:7233"
- "TEMPORAL_CLI_ADDRESS=temporal:7233"
image: temporalio/admin-tools:${TEMPORAL_ADMINTOOLS_VERSION:-1.31.0}
networks:
- temporal-network
stdin_open: true
tty: true
temporal-ui:
depends_on:
temporal:
condition: service_healthy
# Also gate on the namespace job: it makes the UI meaningful, and it
# keeps `docker compose up --wait` happy about the job's exit(0) --
# compose only tolerates exited containers that are
# completed-successfully dependencies of another service.
temporal-create-namespace:
condition: service_completed_successfully
environment:
- TEMPORAL_ADDRESS=temporal:7233
- TEMPORAL_CORS_ORIGINS=http://localhost:3000
image: temporalio/ui:${TEMPORAL_UI_VERSION:-2.49.1}
networks:
- temporal-network
ports:
- ${TEMPORAL_UI_HOST_PORT:-8080}:8080
volumes:
postgres-data: {}
networks:
# No fixed global name: the network is scoped to the compose project so this
# stack can coexist with other temporal stacks on the same machine.
temporal-network:
driver: bridge