-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
91 lines (85 loc) · 2.23 KB
/
docker-compose.yml
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
services:
backend:
build:
context: ../backend
dockerfile: Dockerfile
environment:
- NODE_ENV=${NODE_ENV}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_NAME}
- RABBITMQ_HOST=${RABBITMQ_HOST}
- RABBITMQ_PORT=${RABBITMQ_PORT}
- FRONTEND_PORT=${FRONTEND_PORT}
ports:
- "${BACKEND_PORT}:3000"
depends_on:
postgres:
condition: service_started
rabbitmq:
condition: service_healthy
volumes:
- ../backend/src:/app/src
- ../backend/.env:/app/.env
- ../backend/tsconfig.json:/app/tsconfig.json
- ../backend/ormconfig.ts:/app/ormconfig.ts
frontend:
build:
context: ../frontend
dockerfile: Dockerfile
environment:
- NODE_ENV=${NODE_ENV}
- BACKEND_PORT=${BACKEND_PORT}
ports:
- "${FRONTEND_PORT}:3000"
depends_on:
- backend
volumes:
- ../frontend:/app
- ../frontend/.env:/app/.env
- ../frontend/tsconfig.json:/app/tsconfig.json
- /app/node_modules
postgres:
image: postgres:15-alpine
environment:
POSTGRES_USER: "${DB_USER:-postgres}"
POSTGRES_PASSWORD: "${DB_PASSWORD:-postgres}"
POSTGRES_DB: "${DB_NAME:-postgres}"
ports:
- "${DB_PORT}:5432"
volumes:
- db_data:/var/lib/postgresql/data
- ./init-scripts:/docker-entrypoint-initdb.d
rabbitmq:
image: rabbitmq:management
ports:
- "${RABBITMQ_PORT}:5672"
- "${RABBITMQ_MANAGEMENT_PORT}:15672"
healthcheck:
test: [ "CMD-SHELL", "rabbitmqctl status || exit 1" ]
interval: 10s
timeout: 5s
retries: 5
prometheus:
image: prom/prometheus:latest
container_name: prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "${PROMETHEUS_PORT}:9090"
command:
- "--config.file=/etc/prometheus/prometheus.yml"
grafana:
image: grafana/grafana:latest
container_name: grafana
environment:
- GF_SECURITY_ADMIN_USER="${GRAFANA_USER}"
- GF_SECURITY_ADMIN_PASSWORD="${GRAFANA_PASSWORD}"
ports:
- "${GRAFANA_PORT}:3000"
depends_on:
- prometheus
volumes:
db_data: