-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
40 lines (37 loc) · 1.08 KB
/
Copy pathdocker-compose.yml
File metadata and controls
40 lines (37 loc) · 1.08 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
# 本地开发依赖基础设施
# 启动:docker compose up -d
version: "3.9"
services:
redis:
image: redis:7-alpine
container_name: ms-shared-redis
ports:
- "6379:6379"
command: ["redis-server", "--appendonly", "yes"]
# RabbitMQ:点对点消息队列(RMQ transport 演示,手动 ack / 死信)
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: ms-shared-rabbitmq
ports:
- "5672:5672" # AMQP 协议端口
- "15672:15672" # 管理控制台 http://localhost:15672 (guest/guest)
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 10s
timeout: 5s
retries: 5
# 真实数据库:接入 TypeORM 示例(orders 微服务使用)
postgres:
image: postgres:16-alpine
container_name: ms-shared-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: nestjs_microservices
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5