Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
105 lines (100 loc) · 2.55 KB
/
Copy pathdocker-compose.yml
File metadata and controls
105 lines (100 loc) · 2.55 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
services:
mysql:
image: mysql:8.0
container_name: taskflow_mysql
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: taskflow_dev
MYSQL_USER: taskflow
MYSQL_PASSWORD: taskflow123
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./apps/api/scripts/init-db.sql:/docker-entrypoint-initdb.d/init.sql
command: --default-authentication-plugin=mysql_native_password --log-bin-trust-function-creators=1 --local-infile=1
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-ppassword"]
interval: 5s
timeout: 3s
retries: 10
redis:
image: redis:7-alpine
container_name: taskflow_redis
ports:
- "6379:6379"
command: redis-server --appendonly yes
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
rabbitmq:
image: rabbitmq:3.12-management-alpine
container_name: taskflow_rabbitmq
hostname: rabbitmq
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "ping"]
interval: 5s
timeout: 3s
retries: 5
api:
build:
context: .
dockerfile: apps/api/Dockerfile
container_name: taskflow_api
environment:
NODE_ENV: development
PORT: "3000"
DATABASE_HOST: mysql
DATABASE_PORT: "3306"
DATABASE_USER: taskflow
DATABASE_PASSWORD: taskflow123
DATABASE_NAME: taskflow_dev
REDIS_HOST: redis
REDIS_PORT: "6379"
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672
ports:
- "3000:3000"
entrypoint: ["/bin/sh", "/app/apps/api/scripts/entrypoint.sh"]
volumes:
- .:/app
- /app/node_modules
- /app/apps/api/node_modules
- /app/apps/web/node_modules
- /app/packages/contracts/node_modules
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
web:
build:
context: .
dockerfile: apps/web/Dockerfile
container_name: taskflow_web
environment:
API_URL: http://api:3000
ports:
- "5173:5173"
volumes:
- .:/app
- /app/node_modules
- /app/apps/api/node_modules
- /app/apps/web/node_modules
- /app/packages/contracts/node_modules
depends_on:
- api
volumes:
mysql_data:
redis_data: