-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
114 lines (109 loc) · 2.96 KB
/
docker-compose.yml
File metadata and controls
114 lines (109 loc) · 2.96 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
services:
core:
build:
context: .
dockerfile: docker/core/Dockerfile
args:
APP_NAME: ${APP_NAME}
ports:
- "8000:8000"
volumes:
- ./core:/${APP_NAME}/core
- ./shared:/${APP_NAME}/shared
- ./flow_engine:/${APP_NAME}/flow_engine
environment:
- ENVIRONMENT=${ENVIRONMENT:-dev}
- APP_NAME=${APP_NAME}
- PYTHONPATH=/${APP_NAME}
command: >
sh -c "
if [ \"$$ENVIRONMENT\" = \"dev\" ]; then
uvicorn core.main:create_app --host 0.0.0.0 --port 8000 --reload;
else
gunicorn core.main:create_app --workers 4 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000;
fi
"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8000/docs" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
ui:
build:
context: .
target: ${ENVIRONMENT:-dev}
dockerfile: docker/ui/Dockerfile
args:
APP_NAME: ${APP_NAME}
ports:
- "3001:3000"
volumes:
- ./ui:/${APP_NAME}
- /${APP_NAME}/node_modules
environment:
- VITE_API_URL=${VITE_API_URL}
- APP_NAME=${APP_NAME}
depends_on:
core:
condition: service_healthy
db:
image: postgres:15-alpine
ports:
- "${POSTGRES_PORT}:5432"
environment:
- POSTGRES_HOST=${POSTGRES_HOST:-db}
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_USER=${POSTGRES_USER_NAME}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB_NAME}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER_NAME} -p 5432" ]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
redis:
image: redis:7-alpine
ports:
- "${MSG_BROKER_REDIS_PORT}:6379"
volumes:
- redis_data:/data
command: redis-server --requirepass ${MSG_BROKER_REDIS_PASSWORD:-redis} --appendonly yes
environment:
- REDIS_PASSWORD=${MSG_BROKER_REDIS_PASSWORD:-redis}
healthcheck:
test: [ "CMD", "redis-cli", "-a", "${MSG_BROKER_REDIS_PASSWORD:-redis}", "ping" ]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
rabbitmq:
image: rabbitmq:3-management-alpine
ports:
- "${MSG_BROKER_RABBITMQ_PORT}:5672"
- "${MSG_BROKER_RABBITMQ_UI_PORT}:15672"
environment:
- RABBITMQ_DEFAULT_USER=${MSG_BROKER_RABBITMQ_USERNAME}
- RABBITMQ_DEFAULT_PASS=${MSG_BROKER_RABBITMQ_PASSWORD}
volumes:
- rabbitmq_data:/var/lib/rabbitmq
healthcheck:
test: [ "CMD", "rabbitmq-diagnostics", "check_port_connectivity" ]
interval: 30s
timeout: 10s
retries: 5
start_period: 40s
volumes:
postgres_data:
redis_data:
rabbitmq_data: