-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
159 lines (152 loc) · 4.67 KB
/
Copy pathdocker-compose.yml
File metadata and controls
159 lines (152 loc) · 4.67 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
157
158
159
# =============================================================================
# Docker Compose for swf-monitor + swf-testbed
# =============================================================================
# Starts the full testbed stack:
# - PostgreSQL 16 (primary database)
# - Redis 7 (Django Channels layer for SSE relay)
# - ActiveMQ Artemis (message broker)
# - swf-monitor (Django web application)
# - swf-testbed (CLI: agents + workflow orchestration)
#
# Usage:
# cp ../swf-monitor/.env.example ../swf-monitor/.env # then edit (at minimum set SECRET_KEY)
# docker compose up -d --build
# docker compose logs -f testbed
# =============================================================================
networks:
swf-network:
driver: bridge
services:
# ---------- infrastructure --------------------------------------------------
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${DB_NAME:-swfdb}
POSTGRES_USER: ${DB_USER:-admin}
POSTGRES_PASSWORD: ${DB_PASSWORD:-your_db_password}
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- swf-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
redis:
image: redis:7-alpine
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redisdata:/data
networks:
- swf-network
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
activemq:
image: apache/activemq-artemis:latest-alpine
restart: unless-stopped
ports:
- "8161:8161" # Web console (admin/admin)
- "61616:61616" # Core protocol
- "61613:61613" # STOMP
environment:
ARTEMIS_USER: admin
ARTEMIS_PASSWORD: admin
volumes:
- amqdata:/var/lib/artemis-instance
networks:
- swf-network
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:8161/console/ || exit 1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
# ---------- application -----------------------------------------------------
web:
build:
context: ../swf-monitor/
dockerfile: ../swf-monitor/Dockerfile
restart: unless-stopped
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
env_file:
- ../swf-monitor/.env
environment:
# Override connection hosts to point at Docker service names.
DB_HOST: db
DB_PORT: "5432"
DB_NAME: ${DB_NAME:-swfdb}
DB_USER: ${DB_USER:-admin}
DB_PASSWORD: ${DB_PASSWORD:-your_db_password}
REDIS_URL: redis://redis:6379/0
ACTIVEMQ_HOST: activemq
ACTIVEMQ_PORT: "61613"
# Allow inter-container requests (testbed agents connect via service name)
SWF_ALLOWED_HOSTS: localhost,127.0.0.1,web,testserver
# Django superuser (created automatically on first start)
DJANGO_SUPERUSER_USERNAME: ${DJANGO_SUPERUSER_USERNAME:-admin}
DJANGO_SUPERUSER_EMAIL: ${DJANGO_SUPERUSER_EMAIL:-admin@example.com}
DJANGO_SUPERUSER_PASSWORD: ${DJANGO_SUPERUSER_PASSWORD:-changeme}
networks:
- swf-network
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/ || exit 1"]
interval: 5s
timeout: 5s
retries: 30
start_period: 30s
testbed:
build:
context: ../ # monorepo root (needs swf-common-lib, swf-monitor, swf-testbed)
dockerfile: swf-testbed/Dockerfile
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
activemq:
condition: service_healthy
web:
condition: service_healthy
env_file:
- ../swf-monitor/.env
environment:
# /app is the swf-testbed source root; workflows/ lives there
PYTHONPATH: /app
# Database (used by manage.py get_token in the entrypoint)
DB_HOST: db
DB_PORT: "5432"
DB_NAME: ${DB_NAME:-swfdb}
DB_USER: ${DB_USER:-admin}
DB_PASSWORD: ${DB_PASSWORD:-your_db_password}
# Broker
ACTIVEMQ_HOST: activemq
ACTIVEMQ_PORT: "61613"
ACTIVEMQ_WEB_PORT: "8161"
# Monitor URL (agents report back here)
SWF_MONITOR_URL: http://web:8000
SWF_MONITOR_HTTP_URL: http://web:8000
# Redis
REDIS_URL: redis://redis:6379/0
networks:
- swf-network
volumes:
pgdata:
redisdata:
amqdata: