Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
128 lines (121 loc) · 3.13 KB
/
Copy pathdocker-compose.yml
File metadata and controls
128 lines (121 loc) · 3.13 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
services:
postgres:
image: timescale/timescaledb:latest-pg15
container_name: ims_postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-ims}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-imspass}
POSTGRES_DB: ${POSTGRES_DB:-imsdb}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-ims}"]
interval: 5s
timeout: 5s
retries: 10
mongo:
image: mongo:7
container_name: ims_mongo
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER:-ims}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD:-imspass}
ports:
- "27017:27017"
volumes:
- mongo_data:/data/db
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
container_name: ims_redis
restart: unless-stopped
command: redis-server --requirepass ${REDIS_PASSWORD:-imspass}
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-imspass}", "ping"]
interval: 5s
timeout: 5s
retries: 10
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: ims_backend
restart: unless-stopped
env_file: .env
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
mongo:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./backend:/app
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 10s
timeout: 5s
retries: 5
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: ims_frontend
restart: unless-stopped
ports:
- "3000:3000"
environment:
# These are used by the BROWSER (your laptop), not the container
# So localhost:8000 is correct — the browser hits your host machine
- VITE_API_URL=http://localhost:8000
- VITE_WS_URL=ws://localhost:8000
volumes:
- ./frontend:/app
- /app/node_modules
depends_on:
- backend
prometheus:
image: prom/prometheus:latest
container_name: ims_prometheus
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
grafana:
image: grafana/grafana:latest
container_name: ims_grafana
restart: unless-stopped
ports:
- "3001:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning:/etc/grafana/provisioning
depends_on:
- prometheus
volumes:
postgres_data:
mongo_data:
redis_data:
prometheus_data:
grafana_data: