-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
186 lines (178 loc) · 5.2 KB
/
docker-compose.yml
File metadata and controls
186 lines (178 loc) · 5.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
services:
# PostgreSQL Database with multiple databases support
postgres:
image: postgres:15
container_name: taskmate_postgres
environment:
POSTGRES_USER: taskmate
POSTGRES_PASSWORD: password
POSTGRES_DB: postgres
POSTGRES_MULTIPLE_DATABASES: user_service_db,task_service_db,analytics_service_db,file_service_db,frontend_service_db
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./scripts/create-multiple-postgresql-databases.sh:/docker-entrypoint-initdb.d/create-multiple-postgresql-databases.sh
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U taskmate"]
interval: 30s
timeout: 10s
retries: 5
# Redis for session management and caching
redis:
image: redis:7-alpine
container_name: taskmate_redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 5
# User Service
user-service:
build:
context: ./services/user-service
dockerfile: Dockerfile.dev
container_name: taskmate_user_service
ports:
- "3000:3000"
environment:
- RAILS_ENV=development
- DATABASE_URL=postgresql://taskmate:password@postgres:5432/user_service_db
- DATABASE_HOST=postgres
- DATABASE_USER=taskmate
- REDIS_URL=redis://redis:6379/0
- RAILS_MASTER_KEY_DUMMY=1
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
command: ["./bin/rails", "server", "-b", "0.0.0.0", "-p", "3000"]
networks:
- default
# Task Service
task-service:
build:
context: ./services/task-service
dockerfile: Dockerfile
container_name: taskmate_task_service
ports:
- "3001:3001"
environment:
- RAILS_ENV=development
- DATABASE_URL=postgresql://taskmate:password@postgres:5432/task_service_db
- REDIS_URL=redis://redis:6379/1
- USER_SERVICE_URL=http://user-service:3000
- RAILS_MASTER_KEY_DUMMY=1
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
user-service:
condition: service_started
command: ["./bin/rails", "server", "-b", "0.0.0.0", "-p", "3001"]
networks:
- default
# Analytics Service
analytics-service:
build:
context: ./services/analytics-service
dockerfile: Dockerfile
container_name: taskmate_analytics_service
ports:
- "3002:3002"
environment:
- RAILS_ENV=development
- DATABASE_URL=postgresql://taskmate:password@postgres:5432/analytics_service_db
- REDIS_URL=redis://redis:6379/2
- USER_SERVICE_URL=http://user-service:3000
- TASK_SERVICE_URL=http://task-service:3001
- RAILS_MASTER_KEY_DUMMY=1
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
user-service:
condition: service_started
task-service:
condition: service_started
command: ["./bin/rails", "server", "-b", "0.0.0.0", "-p", "3002"]
networks:
- default
# File Service
file-service:
build:
context: ./services/file-service
dockerfile: Dockerfile
container_name: taskmate_file_service
ports:
- "3003:3003"
environment:
- RAILS_ENV=development
- DATABASE_URL=postgresql://taskmate:password@postgres:5432/file_service_db
- REDIS_URL=redis://redis:6379/3
- USER_SERVICE_URL=http://user-service:3000
- TASK_SERVICE_URL=http://task-service:3001
- RAILS_MASTER_KEY_DUMMY=1
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
user-service:
condition: service_started
task-service:
condition: service_started
volumes:
- file_uploads:/app/storage
command: ["./bin/rails", "server", "-b", "0.0.0.0", "-p", "3003"]
networks:
- default
# Frontend Service
frontend-service:
build:
context: ./services/frontend-service
dockerfile: Dockerfile.dev
container_name: taskmate_frontend_service
ports:
- "3100:3100"
environment:
- RAILS_ENV=development
- DATABASE_URL=postgresql://taskmate:password@postgres:5432/frontend_service_db
- REDIS_URL=redis://redis:6379/4
- USER_SERVICE_URL=http://user-service:3000
- TASK_SERVICE_URL=http://task-service:3001
- ANALYTICS_SERVICE_URL=http://analytics-service:3002
- FILE_SERVICE_URL=http://file-service:3003
- SECRET_KEY_BASE=dummy_key_for_development
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
user-service:
condition: service_started
task-service:
condition: service_started
analytics-service:
condition: service_started
file-service:
condition: service_started
command: ["./bin/rails", "server", "-b", "0.0.0.0", "-p", "3100"]
networks:
- default
volumes:
postgres_data:
redis_data:
file_uploads:
networks:
default:
name: taskmate_network