forked from AudioBitsStellar/AudioBlock_Backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
141 lines (135 loc) · 3.42 KB
/
Copy pathdocker-compose.yml
File metadata and controls
141 lines (135 loc) · 3.42 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
services:
backend:
container_name: audioblocks-backend
build:
context: .
dockerfile: Dockerfile
ports:
- "4000:4000"
env_file: .env.docker
environment:
- NODE_ENV=development
depends_on:
- db
- redis
# RabbitMQ is optional for the minimal stack (API + DB + Redis). The
# backend starts without it and connects lazily; `docker compose up`
# (no profile) therefore omits rabbitmq. Use `--profile full` or
# `--profile queue` to include it.
volumes:
- .:/app
- /app/node_modules
- ./uploads:/app/uploads
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:4000/health/live', (r) => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))"]
interval: 30s
timeout: 5s
start_period: 15s
retries: 3
db:
container_name: audioblocks-db
image: postgres:15-alpine
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 1234
POSTGRES_DB: audioblocks
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: redis-server
ports:
- '6379:6379'
restart: always
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
pgadmin:
image: dpage/pgadmin4:latest
container_name: pgadmin
restart: always
ports:
- "5050:80"
environment:
PGADMIN_DEFAULT_EMAIL: admin@local.com
PGADMIN_DEFAULT_PASSWORD: admin123
volumes:
- pgadmin_data:/var/lib/pgadmin
depends_on:
- db
profiles:
- full
- tools
rabbitmq:
image: rabbitmq:3-management
container_name: rabbitmq
restart: always
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASS}
volumes:
- rabbitmq_data:/var/lib/rabbitmq
profiles:
- full
- queue
- messaging
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: always
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
profiles:
- full
- monitoring
- observability
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: always
ports:
- "3000:3000"
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
GF_INSTALL_PLUGINS: ""
volumes:
- ./monitoring/grafana/provisioning.yml:/etc/grafana/provisioning/provisioning.yml:ro
- ./monitoring/dashboards:/etc/grafana/provisioning/dashboards:ro
- grafana_data:/var/lib/grafana
depends_on:
- prometheus
profiles:
- full
- monitoring
- observability
volumes:
pgdata:
redisdata:
pgadmin_data:
rabbitmq_data:
prometheus_data:
grafana_data: