-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
151 lines (140 loc) · 4.09 KB
/
docker-compose.prod.yml
File metadata and controls
151 lines (140 loc) · 4.09 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
version: '3.8'
# ============================================================================
# News Microservices - Production Docker Compose
# ============================================================================
# Production deployment configuration with:
# - Frontend (Nginx + React build) on port 80
# - All backend services in internal network (no external ports)
# - RabbitMQ Management UI on port 15672 (for monitoring)
# ============================================================================
# Global logging configuration
x-logging: &default-logging
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
compress: "true"
networks:
news_network:
driver: bridge
volumes:
postgres_data:
redis_data:
rabbitmq_data:
neo4j_data:
n8n_data:
prometheus_data:
grafana_data:
services:
# ==========================================================================
# Infrastructure Services
# ==========================================================================
postgres:
logging: *default-logging
image: postgres:15-alpine
container_name: postgres
restart: unless-stopped
pids_limit: 512
command: postgres -c max_connections=300 -c shared_buffers=256MB
environment:
POSTGRES_USER: news_user
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-+t1koDEJO+ruZ3QnYlkVeU2u6Z+zCJtL6wFW+wfN5Yk=}
POSTGRES_DB: news_mcp
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- news_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U news_user"]
interval: 10s
timeout: 5s
retries: 5
redis:
logging: *default-logging
image: redis:7-alpine
container_name: redis
restart: unless-stopped
pids_limit: 512
command: >
redis-server
--appendonly yes
--appendfsync everysec
--auto-aof-rewrite-percentage 100
--auto-aof-rewrite-min-size 64mb
--maxmemory 1gb
--maxmemory-policy allkeys-lru
--requirepass redis_secret_2024
--save 900 1
--save 300 10
--save 60 10000
volumes:
- redis_data:/data
networks:
- news_network
healthcheck:
test: ["CMD", "redis-cli", "-a", "redis_secret_2024", "ping"]
interval: 10s
timeout: 5s
retries: 5
rabbitmq:
logging: *default-logging
image: rabbitmq:3-management-alpine
container_name: rabbitmq
restart: unless-stopped
pids_limit: 512
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER:-guest}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASS:-guest}
volumes:
- rabbitmq_data:/var/lib/rabbitmq
- ./certs/rabbitmq:/etc/rabbitmq/certs:ro
- ./rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro
ports:
- "15672:15672" # Management UI (external for monitoring)
networks:
- news_network
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 30s
timeout: 10s
retries: 5
neo4j:
logging: *default-logging
image: neo4j:5.25-community
container_name: neo4j
restart: unless-stopped
pids_limit: 512
environment:
NEO4J_AUTH: neo4j/neo4j_password_2024
NEO4J_PLUGINS: '["apoc"]'
volumes:
- neo4j_data:/data
networks:
- news_network
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:7474 || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# ==========================================================================
# Frontend (Nginx + React Build) - Port 80
# ==========================================================================
frontend:
logging: *default-logging
build:
context: ./frontend
dockerfile: Dockerfile.prod
container_name: news-frontend-production
restart: unless-stopped
pids_limit: 512
ports:
- "80:80" # Main entry point for entire application
networks:
- news_network
healthcheck:
test: ["CMD-SHELL", "wget --quiet --tries=1 --spider http://localhost/ || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s