-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
58 lines (54 loc) · 1.74 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
58 lines (54 loc) · 1.74 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
# Declares volumes that can be used by services in the Docker Compose file
volumes:
# Declares a volume named grafana_data
grafana_data: {}
# Defines networks that can be used by services in the Docker Compose file
networks:
# Declares a network named front-tier
front-tier:
# Declares a network named back-tier
back-tier:
# Defines the services that make up your app
services:
# Defines a service named db
db:
# Specifies the Docker image to use for this service
image: postgres
# Ensures that the service is always restarted if it stops
restart: always
# Sets environment variables for the service
environment:
# Sets the password for the Postgres database
POSTGRES_PASSWORD: example
# Maps ports between the host and the container
ports:
- "5432:5432"
# Specifies the networks that this service is part of
networks:
- back-tier
# Defines a service named adminer
adminer:
image: adminer
restart: always
ports:
- "8080:8080" # host:container
networks:
- back-tier
- front-tier
# Defines a service named grafana
grafana:
image: grafana/grafana-enterprise
# Sets the user ID under which the service will run
user: "472"
ports:
- "3000:3000"
# Maps local directories or files to directories inside the container
volumes:
# Maps a local file to a file inside the container, and makes it read-only
- ./grafana/grafana_datasources.yaml:/etc/grafana/provisioning/datasources/datasource.yaml:ro
- ./grafana/grafana_dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml:ro
- ./grafana/dashboards:/opt/grafana/dashboards
networks:
- back-tier
- front-tier
restart: always