-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
86 lines (80 loc) · 1.91 KB
/
docker-compose.yml
File metadata and controls
86 lines (80 loc) · 1.91 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
services:
# PostgreSQL Database
postgres:
image: postgres:16-alpine
container_name: queue_worker_postgres
environment:
POSTGRES_DB: queue_worker
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgrespw
ports:
- '55000:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres -d queue_worker']
interval: 10s
timeout: 5s
retries: 5
networks:
- queue_worker_network
# RabbitMQ Message Broker
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: queue_worker_rabbitmq
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- '5672:5672' # AMQP port
- '15672:15672' # Management UI port
volumes:
- rabbitmq_data:/var/lib/rabbitmq
healthcheck:
test: ['CMD', 'rabbitmq-diagnostics', 'ping']
interval: 10s
timeout: 5s
retries: 5
networks:
- queue_worker_network
# NestJS Application
app:
build:
context: .
dockerfile: Dockerfile
target: production
container_name: queue_worker_app
environment:
NODE_ENV: production
HOST: 0.0.0.0
PORT: 3030
# Database configuration
DB_NAME: queue_worker
DB_HOST: postgres
DB_USERNAME: postgres
DB_PASSWORD: postgrespw
DB_PORT: 5432
DB_SYNCHRONIZE: true
# RabbitMQ configuration
RABBITMQ_USER: guest
RABBITMQ_PASSWORD: guest
RABBITMQ_HOST: rabbitmq
RABBITMQ_QUEUE_NAME: worker_queue
ports:
- '3030:3030'
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
restart: unless-stopped
networks:
- queue_worker_network
volumes:
postgres_data:
driver: local
rabbitmq_data:
driver: local
networks:
queue_worker_network:
driver: bridge