Repository navigation
Expand file tree
/
Copy pathdocker-compose.published.yml
More file actions
90 lines (86 loc) · 3.46 KB
/
Copy pathdocker-compose.published.yml
File metadata and controls
90 lines (86 loc) · 3.46 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
name: durable-workflow-server
# The published Durable Workflow Server: the native (Rust) server and MySQL.
#
# curl -fsSLO https://raw.githubusercontent.com/durable-workflow/server/main/docker-compose.published.yml
# docker compose -f docker-compose.published.yml up -d --wait
#
# Native is one process. It creates and checks its own schema at startup and
# runs its maintenance (timers, repair, retention) in the same process, so
# there is no bootstrap job, queue worker, scheduler or Redis. The PHP 2.x
# server's Compose file is docker-compose.php.yml; to keep running PHP, use
# that file (or pin a 2.x release of this one).
#
# The default image is the native release this commit is tagged as: a final
# release's commit moves it (verify-native-release-dispatch.sh refuses a
# release whose default names another image). Set DW_SERVER_IMAGE to run
# any other native image, by tag or digest; pin a digest for production
# change control.
x-server-image: &server-image ${DW_SERVER_IMAGE:-durableworkflow/server:3.11.0}
services:
server:
image: *server-image
platform: ${DW_SERVER_PLATFORM:-}
restart: unless-stopped
# Loopback only by default. For remote access set SERVER_BIND_ADDRESS to a
# protected private interface and terminate HTTPS at a reverse proxy.
ports:
- "${SERVER_BIND_ADDRESS:-127.0.0.1}:${SERVER_PORT:-8080}:8080"
environment:
# Release candidates refuse to start without this opt-in. The final
# 3.0.0 image does not need it.
DW_RUST_EXPERIMENTAL: "1"
DW_SERVER_KEY: ${DW_SERVER_KEY:-}
DB_CONNECTION: mysql
DB_HOST: mysql
DB_PORT: 3306
DB_DATABASE: ${DB_DATABASE:-durable_workflow}
DB_USERNAME: ${DB_USERNAME:-workflow}
DB_PASSWORD: ${DB_PASSWORD:-workflow}
# Token auth. There is no default token: Compose refuses to start until
# DW_AUTH_TOKEN is set. Native requires this shared token and accepts it
# for every role (it refuses DW_AUTH_BACKWARD_COMPATIBLE=false), so use a
# strong random value outside local testing. The role tokens add
# narrower worker, operator and admin tokens.
DW_AUTH_DRIVER: ${DW_AUTH_DRIVER:-token}
DW_AUTH_TOKEN: ${DW_AUTH_TOKEN:?Set DW_AUTH_TOKEN, for example export DW_AUTH_TOKEN=dev-token for local testing}
DW_RUNTIME_CREDENTIALS_ENABLED: ${DW_RUNTIME_CREDENTIALS_ENABLED:-false}
DW_WORKER_TOKEN: ${DW_WORKER_TOKEN:-}
DW_OPERATOR_TOKEN: ${DW_OPERATOR_TOKEN:-}
DW_ADMIN_TOKEN: ${DW_ADMIN_TOKEN:-}
volumes:
- server_storage:/app/storage
depends_on:
mysql:
condition: service_healthy
# The image has no curl; bash's /dev/tcp reads /api/ready.
healthcheck:
test:
- CMD
- bash
- -c
- >-
exec 3<>/dev/tcp/127.0.0.1/8080 &&
printf 'GET /api/ready HTTP/1.0\r\nHost: localhost\r\n\r\n' >&3 &&
head -n 1 <&3 | grep -q ' 200 '
interval: 10s
timeout: 5s
retries: 3
start_period: 20s
stop_grace_period: 30s
mysql:
image: mysql:${MYSQL_VERSION:-8.0}
environment:
MYSQL_DATABASE: ${DB_DATABASE:-durable_workflow}
MYSQL_USER: ${DB_USERNAME:-workflow}
MYSQL_PASSWORD: ${DB_PASSWORD:-workflow}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-root}
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 3s
retries: 20
volumes:
mysql_data:
server_storage: