-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
157 lines (150 loc) · 4.31 KB
/
docker-compose.yml
File metadata and controls
157 lines (150 loc) · 4.31 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
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: integration_gateway
POSTGRES_USER: app
POSTGRES_PASSWORD: app
ports:
- '5434:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U app -d integration_gateway']
interval: 5s
timeout: 5s
retries: 20
rabbitmq:
image: rabbitmq:3.13-management-alpine
ports:
- '5672:5672'
- '15672:15672'
healthcheck:
test: ['CMD', 'rabbitmq-diagnostics', '-q', 'ping']
interval: 5s
timeout: 5s
retries: 20
redis:
image: redis:7-alpine
ports:
- '6381:6379'
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 5s
retries: 20
migrator:
build:
context: .
dockerfile: docker/node/Dockerfile
environment:
NODE_ENV: development
APP_HOST: 0.0.0.0
APP_PORT: 3000
LOG_LEVEL: info
DATABASE_URL: postgres://app:app@postgres:5432/integration_gateway
REDIS_URL: redis://redis:6379
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672
RABBITMQ_PROCESS_QUEUE: ig.events.process
RABBITMQ_RETRY_QUEUE: ig.events.retry
RABBITMQ_REPLAY_QUEUE: ig.events.replay
WEBHOOK_RATE_LIMIT_PER_MINUTE: 120
IDEMPOTENCY_TTL_SECONDS: 86400
PROCESSING_LOCK_TTL_SECONDS: 60
MAX_PROCESSING_RETRIES: 3
RETRY_BASE_DELAY_MS: 5000
DB_MIGRATIONS_TABLE: schema_migrations
MANAGEMENT_API_KEY: local-internal-management-key
command: ['sh', '-c', 'npm run db:migrate && npm run db:seed']
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
redis:
condition: service_healthy
restart: 'no'
api:
build:
context: .
dockerfile: docker/node/Dockerfile
environment:
NODE_ENV: development
APP_HOST: 0.0.0.0
APP_PORT: 3000
LOG_LEVEL: info
DATABASE_URL: postgres://app:app@postgres:5432/integration_gateway
REDIS_URL: redis://redis:6379
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672
RABBITMQ_PROCESS_QUEUE: ig.events.process
RABBITMQ_RETRY_QUEUE: ig.events.retry
RABBITMQ_REPLAY_QUEUE: ig.events.replay
WEBHOOK_RATE_LIMIT_PER_MINUTE: 120
IDEMPOTENCY_TTL_SECONDS: 86400
PROCESSING_LOCK_TTL_SECONDS: 60
MAX_PROCESSING_RETRIES: 3
RETRY_BASE_DELAY_MS: 5000
DB_MIGRATIONS_TABLE: schema_migrations
MANAGEMENT_API_KEY: local-internal-management-key
command: ['npm', 'run', 'start']
ports:
- '3000:3000'
depends_on:
migrator:
condition: service_completed_successfully
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
redis:
condition: service_healthy
restart: on-failure
healthcheck:
test: ['CMD-SHELL', 'curl -fsS http://localhost:3000/api/v1/health >/dev/null || exit 1']
interval: 10s
timeout: 5s
retries: 10
worker:
build:
context: .
dockerfile: docker/node/Dockerfile
environment:
NODE_ENV: development
APP_HOST: 0.0.0.0
APP_PORT: 3000
LOG_LEVEL: info
DATABASE_URL: postgres://app:app@postgres:5432/integration_gateway
REDIS_URL: redis://redis:6379
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672
RABBITMQ_PROCESS_QUEUE: ig.events.process
RABBITMQ_RETRY_QUEUE: ig.events.retry
RABBITMQ_REPLAY_QUEUE: ig.events.replay
WEBHOOK_RATE_LIMIT_PER_MINUTE: 120
IDEMPOTENCY_TTL_SECONDS: 86400
PROCESSING_LOCK_TTL_SECONDS: 60
MAX_PROCESSING_RETRIES: 3
RETRY_BASE_DELAY_MS: 5000
DB_MIGRATIONS_TABLE: schema_migrations
MANAGEMENT_API_KEY: local-internal-management-key
command: ['npm', 'run', 'worker']
depends_on:
migrator:
condition: service_completed_successfully
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
redis:
condition: service_healthy
restart: on-failure
nginx:
image: nginx:1.27-alpine
ports:
- '8082:80'
volumes:
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
api:
condition: service_healthy
volumes:
postgres_data: