-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
77 lines (71 loc) · 1.55 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
version: '3'
services:
# Application
app:
build:
context: .
dockerfile: Dockerfile
container_name: 'app-${APP_NAME}'
ports:
- '3333:${APP_PORT}'
environment:
- DATABASE_HOST=database
- DATABASE_PORT=${DATABASE_PORT}
- DATABASE_NAME=${DATABASE_NAME}
- DATABASE_USER=${DATABASE_USER}
- DATABASE_PASSWORD=${DATABASE_PASS}
- PROMETHEUS_PORT=9090
depends_on:
- database
- prometheus
networks:
- app
env_file:
- .env
# Database
database:
image: 'bitnami/mysql:latest'
container_name: 'mysql-${APP_NAME}'
ports:
- '${DATABASE_PORT}:3306'
environment:
- MYSQL_DATABASE=${DATABASE_NAME}
- MYSQL_USER=${DATABASE_USER}
- MYSQL_PASSWORD=${DATABASE_PASS}
- MYSQL_ROOT_PASSWORD=${DATABASE_ROOT_PASSWORD}
volumes:
- 'mysql_data:/bitnami/mysql'
networks:
- app
env_file:
- .env
# Grafana
grafana:
image: grafana/grafana:latest
container_name: 'grafana-${APP_NAME}'
ports:
- '3001:3000'
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
volumes:
- 'grafana_data:/var/lib/grafana'
networks:
- app
# Prometheus
prometheus:
image: prom/prometheus
container_name: 'prometheus-${APP_NAME}'
ports:
- '9090:9090'
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
networks:
- app
networks:
app:
driver: bridge
volumes:
mysql_data:
driver: local
grafana_data:
driver: local