-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
72 lines (66 loc) · 2.02 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
version: '2.1'
services:
fastapi-example:
image: fastapi-example-features:latest
container_name: fastapi-example-container
hostname: fastapi-example-host
build:
context: ./app
env_file:
- ./app/.env.docker-compose
depends_on:
mysql:
condition: service_healthy
nginx:
image: nginx:latest
hostname: nginx-host
ports:
- "8080:8080"
container_name: nginx-container
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
depends_on:
- mysql
- fastapi-example
mysql:
image: mysql:latest
container_name: mysql-container
hostname: mysql-host
environment:
MYSQL_ROOT_PASSWORD: test
MYSQL_DATABASE: test
MYSQL_USER: test
MYSQL_PASSWORD: test
volumes:
- ./database/base/01_init_db.sql:/docker-entrypoint-initdb.d/01_init_db.sql
- ./database/base/02_schema.sql:/docker-entrypoint-initdb.d/02_schema.sql
- ./database/base/03_data.sql:/docker-entrypoint-initdb.d/03_data.sql
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 8s
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: unless-stopped
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
- '--web.route-prefix=/prometheus/'
- '--web.external-url=/prometheus/'
grafana:
image: grafana/grafana
container_name: grafana
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_SERVER_ROOT_URL=http://localhost:3000/grafana
- GF_SERVER_SERVE_FROM_SUB_PATH=true
- GF_DASHBOARDS_JSON_ENABLED=true
volumes:
- ./grafana/provisioning:/etc/grafana/provisioning