-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
102 lines (96 loc) · 2.85 KB
/
docker-compose.yml
File metadata and controls
102 lines (96 loc) · 2.85 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
services:
# Mock Service Application
app:
build:
context: .
dockerfile: dockerfile
container_name: ondc-mock-service
env_file:
- .env
restart: unless-stopped
ports:
- '${PORT:-3000}:3000'
environment:
NODE_ENV: ${NODE_ENV:-production}
PORT: 3000
LOG_LEVEL: ${LOG_LEVEL:-info}
API_SERVICE_URL: ${API_SERVICE_URL}
CONFIG_SERVICE_URL: ${CONFIG_SERVICE_URL}
# Redis Configuration
REDIS_HOST: ${REDIS_HOST:-}
REDIS_PORT: ${REDIS_PORT:-6379}
REDIS_USERNAME: ${REDIS_USERNAME:-}
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
REDIS_DB_0: ${REDIS_DB_0:-0}
REDIS_DB_1: ${REDIS_DB_1:-1}
# RabbitMQ Configuration
RABBITMQ_URL: amqp://${RABBITMQ_USER:-guest}:${RABBITMQ_PASS:-guest}@rabbitmq:5672
depends_on:
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
- ondc-network
healthcheck:
test:
[
'CMD',
'node',
'-e',
"require('http').get('http://localhost:3000/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Redis Cache
redis:
image: redis:7-alpine
container_name: ondc-redis
restart: unless-stopped
ports:
- '6379:6379'
command: >
redis-server
--appendonly yes
--requirepass ${REDIS_PASSWORD:-}
volumes:
- redis-data:/data
networks:
- ondc-network
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 5s
retries: 5
# RabbitMQ Message Queue
rabbitmq:
image: rabbitmq:3.13-management-alpine
container_name: ondc-rabbitmq
restart: unless-stopped
ports:
- '5672:5672' # AMQP port
- '15672:15672' # Management UI
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER:-guest}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASS:-guest}
RABBITMQ_DEFAULT_VHOST: /
volumes:
- rabbitmq-data:/var/lib/rabbitmq
networks:
- ondc-network
healthcheck:
test: ['CMD', 'rabbitmq-diagnostics', 'ping']
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
networks:
ondc-network:
driver: bridge
volumes:
redis-data:
driver: local
rabbitmq-data:
driver: local