-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathdocker-compose.integration.yml
More file actions
156 lines (150 loc) · 4.69 KB
/
Copy pathdocker-compose.integration.yml
File metadata and controls
156 lines (150 loc) · 4.69 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# Docker Compose for Waterline Phase 0 Integration Test
# Spins up durableworkflow/server for end-to-end validation
#
# Usage:
# git -C ../workflow fetch origin v2
# WORKFLOW_PACKAGE_COMMIT="$(git -C ../workflow rev-parse origin/v2)" \
# docker compose -f docker-compose.integration.yml up -d --build
# docker compose -f docker-compose.integration.yml down -v
services:
# Database shared between server and waterline
mysql:
image: mysql:8.0
environment:
MYSQL_DATABASE: durable_workflow
MYSQL_USER: workflow
MYSQL_PASSWORD: workflow
MYSQL_ROOT_PASSWORD: root
ports:
- "33066:3306" # Non-standard port to avoid conflicts
volumes:
- integration_mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 3s
retries: 10
redis:
image: redis:7-alpine
ports:
- "63799:6379" # Non-standard port to avoid conflicts
volumes:
- integration_redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
# Bootstrap server (migrations)
server-bootstrap:
build:
context: ${SERVER_SOURCE_PATH:-../server}
dockerfile: Dockerfile
args:
# Use the workflow v2 branch from the workflow repo
WORKFLOW_PACKAGE_SOURCE: https://github.com/durable-workflow/workflow.git
WORKFLOW_PACKAGE_REF: v2
WORKFLOW_PACKAGE_COMMIT: ${WORKFLOW_PACKAGE_COMMIT:-}
command: ["server-bootstrap"]
environment:
APP_NAME: "Durable Workflow Server (Integration)"
APP_ENV: local
APP_KEY: "base64:UTyp33UhGolgzCK5CJmT+hNHcA+dJyp3+oINtX+VoPI="
APP_DEBUG: "true"
APP_VERSION: "${SERVER_VERSION:-2.0.0-rc.32}"
DB_CONNECTION: mysql
DB_HOST: mysql
DB_PORT: 3306
DB_DATABASE: durable_workflow
DB_USERNAME: workflow
DB_PASSWORD: workflow
REDIS_HOST: redis
REDIS_PORT: 6379
QUEUE_CONNECTION: redis
CACHE_STORE: redis
WORKFLOW_SERVER_AUTH_DRIVER: token
WORKFLOW_SERVER_AUTH_TOKEN: "integration-test-token-123"
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
# Main server API
server:
build:
context: ${SERVER_SOURCE_PATH:-../server}
dockerfile: Dockerfile
args:
WORKFLOW_PACKAGE_SOURCE: https://github.com/durable-workflow/workflow.git
WORKFLOW_PACKAGE_REF: v2
WORKFLOW_PACKAGE_COMMIT: ${WORKFLOW_PACKAGE_COMMIT:-}
ports:
- "8081:8080" # Map to 8081 to avoid conflicts with local dev
environment:
APP_NAME: "Durable Workflow Server (Integration)"
APP_ENV: local
APP_KEY: "base64:UTyp33UhGolgzCK5CJmT+hNHcA+dJyp3+oINtX+VoPI="
APP_DEBUG: "true"
APP_VERSION: "${SERVER_VERSION:-2.0.0-rc.32}"
DB_CONNECTION: mysql
DB_HOST: mysql
DB_PORT: 3306
DB_DATABASE: durable_workflow
DB_USERNAME: workflow
DB_PASSWORD: workflow
REDIS_HOST: redis
REDIS_PORT: 6379
QUEUE_CONNECTION: redis
CACHE_STORE: redis
WORKFLOW_SERVER_AUTH_DRIVER: token
WORKFLOW_SERVER_AUTH_TOKEN: "integration-test-token-123"
depends_on:
server-bootstrap:
condition: service_completed_successfully
mysql:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# Queue worker for async task processing
worker:
build:
context: ${SERVER_SOURCE_PATH:-../server}
dockerfile: Dockerfile
args:
WORKFLOW_PACKAGE_SOURCE: https://github.com/durable-workflow/workflow.git
WORKFLOW_PACKAGE_REF: v2
WORKFLOW_PACKAGE_COMMIT: ${WORKFLOW_PACKAGE_COMMIT:-}
command: php artisan queue:work --sleep=1 --tries=3 --max-time=3600
environment:
APP_NAME: "Durable Workflow Server (Integration)"
APP_ENV: local
APP_KEY: "base64:UTyp33UhGolgzCK5CJmT+hNHcA+dJyp3+oINtX+VoPI="
APP_VERSION: "${SERVER_VERSION:-2.0.0-rc.32}"
DB_CONNECTION: mysql
DB_HOST: mysql
DB_PORT: 3306
DB_DATABASE: durable_workflow
DB_USERNAME: workflow
DB_PASSWORD: workflow
REDIS_HOST: redis
REDIS_PORT: 6379
QUEUE_CONNECTION: redis
CACHE_STORE: redis
depends_on:
server-bootstrap:
condition: service_completed_successfully
server:
condition: service_healthy
mysql:
condition: service_healthy
redis:
condition: service_healthy
volumes:
integration_mysql_data:
integration_redis_data: