-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
83 lines (78 loc) · 1.96 KB
/
docker-compose.yaml
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
services:
database:
container_name: 'postgres'
image: 'postgres:14'
restart: always
networks:
- default
env_file:
- .env
ports:
- '${POSTGRES_PORT}:5432'
environment:
POSTGRES_MAX_CONNECTIONS: 200
volumes:
- data:/var/lib/postgresql/data
- ./deploy/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}" ]
interval: 5s
retries: 5
start_period: 5s
timeout: 2s
prometheus:
container_name: 'prometheus'
image: prom/prometheus:v2.30.3
ports:
- 9090:9090
networks:
- default
volumes:
- ./prometheus:/etc/prometheus
- prometheus-data:/prometheus
command: --web.enable-lifecycle --config.file=/etc/prometheus/prometheus.yaml
grafana: # login: admin, password: admin
container_name: 'grafana'
image: grafana/grafana:7.5.7
networks:
- default
ports:
- 3333:3000
volumes:
- ./graphana/datasources:/etc/grafana/provisioning/datasources
- ./graphana/dashboards:/etc/grafana/provisioning/dashboards
- grafana-data:/var/lib/grafana
backend:
container_name: 'backend'
networks:
- default
depends_on:
database:
condition: service_healthy
restart: always
env_file: .env
environment:
- POSTGRES_HOST=database
build: ./backend
volumes:
- ./certs:/etc/ssl
ports:
- "${APP_PORT}:${APP_PORT}"
- "${PROMETHEUS_PORT}:${PROMETHEUS_PORT}"
command: [ "sh", "-c", "poetry run alembic upgrade head && poetry run python -m app" ]
nginx:
container_name: 'nginx'
image: nginx:latest
ports:
- "80:80" # HTTP
volumes:
- ./nginx/nginx-dev.conf:/etc/nginx/nginx.conf # Dev Nginx configuration
- ./certs:/etc/ssl # SSL certificates
depends_on:
- backend
networks:
default:
volumes:
data:
prometheus-data:
grafana-data: