forked from adammc769/calico
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
169 lines (161 loc) · 4.2 KB
/
docker-compose.yml
File metadata and controls
169 lines (161 loc) · 4.2 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
160
161
162
163
164
165
166
167
168
169
services:
# Python Backend API Server
api-server:
build: .
container_name: calico-api-server
command: python -m calico.workflow.cli serve-api --host 0.0.0.0 --port 8000
ports:
- "8000:8000"
env_file:
- .env
environment:
- PYTHONUNBUFFERED=1
- DATABASE_URL=${DATABASE_URL:-postgresql+psycopg2://calico:calico@postgres:5432/calico}
- CELERY_BROKER_URL=${CELERY_BROKER_URL:-redis://redis:6379/0}
volumes:
- .:/app
- calico-playwright-cache:/root/.cache/ms-playwright
depends_on:
- redis
- postgres
networks:
- calico-network
extra_hosts:
- "host.docker.internal:host-gateway"
shm_size: '2gb'
mem_limit: 8g
# Interactive CLI Container
cli:
build: .
container_name: calico-cli
command: /bin/bash
stdin_open: true
tty: true
env_file:
- .env
environment:
- PYTHONUNBUFFERED=1
- DATABASE_URL=${DATABASE_URL:-postgresql+psycopg2://calico:calico@postgres:5432/calico}
- CELERY_BROKER_URL=${CELERY_BROKER_URL:-redis://redis:6379/0}
volumes:
- .:/app
- calico-playwright-cache:/root/.cache/ms-playwright
- calico-cli-history:/root/.calico
depends_on:
- redis
- postgres
networks:
- calico-network
profiles:
- cli
shm_size: '2gb'
mem_limit: 8g
# General App Container (for testing and utilities)
app:
build: .
container_name: calico-app
command: sleep infinity
env_file:
- .env
environment:
- PYTHONUNBUFFERED=1
- DATABASE_URL=${DATABASE_URL:-postgresql+psycopg2://calico:calico@postgres:5432/calico}
- CELERY_BROKER_URL=${CELERY_BROKER_URL:-redis://redis:6379/0}
volumes:
- .:/app
- calico-playwright-cache:/root/.cache/ms-playwright
depends_on:
- redis
- postgres
networks:
- calico-network
shm_size: '2gb'
mem_limit: 8g
# Celery Worker
celery-worker:
build: .
container_name: calico-celery-worker
command: celery -A calico.workflow.celery_app worker --loglevel=info
env_file:
- .env
environment:
- PYTHONUNBUFFERED=1
- DATABASE_URL=${DATABASE_URL:-postgresql+psycopg2://calico:calico@postgres:5432/calico}
- CELERY_BROKER_URL=${CELERY_BROKER_URL:-redis://redis:6379/0}
volumes:
- .:/app
- calico-playwright-cache:/root/.cache/ms-playwright
depends_on:
- redis
- postgres
networks:
- calico-network
shm_size: '2gb'
mem_limit: 8g
# Celery Beat Scheduler
celery-beat:
build: .
container_name: calico-celery-beat
command: celery -A calico.workflow.celery_app beat --loglevel=info
env_file:
- .env
environment:
- PYTHONUNBUFFERED=1
- DATABASE_URL=${DATABASE_URL:-postgresql+psycopg2://calico:calico@postgres:5432/calico}
- CELERY_BROKER_URL=${CELERY_BROKER_URL:-redis://redis:6379/0}
volumes:
- .:/app
- calico-playwright-cache:/root/.cache/ms-playwright
depends_on:
- redis
- postgres
networks:
- calico-network
# Redis Cache/Broker
redis:
image: redis:7-alpine
container_name: calico-redis
ports:
- "6379:6379"
volumes:
- calico-redis-data:/data
networks:
- calico-network
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: calico-postgres
environment:
- POSTGRES_DB=${POSTGRES_DB:-calico}
- POSTGRES_USER=${POSTGRES_USER:-calico}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-calico}
- PGDATA=/var/lib/postgresql/data/pgdata
ports:
- "5432:5432"
volumes:
- calico-postgres-data:/var/lib/postgresql/data
networks:
- calico-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-calico}"]
interval: 10s
timeout: 5s
retries: 5
networks:
calico-network:
driver: bridge
volumes:
calico-playwright-cache:
driver: local
calico-redis-data:
driver: local
calico-postgres-data:
driver: local
calico-cli-history:
driver: local