-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
108 lines (105 loc) · 2.73 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
version: '3.7'
services:
db:
container_name: "gallery-db"
platform: linux/x86_64
build:
context: .
dockerfile: db.Dockerfile
networks:
- default
restart: always
ports:
# <Port exposed> : < MySQL Port running inside container>
- "3306:3306"
# setting some env vars to create the DB
environment:
MYSQL_ROOT_PASSWORD: "123456"
MYSQL_DATABASE: "user"
# OR if you want to use "root" as the user, just these two lines
# MYSQL_ROOT_PASSWORD: ${DATABASE_PASSWORD}
# MYSQL_DATABASE: ${DATABASE_NAME}
# we mount a data volume to make sure we don't lose data
volumes:
- mysql_data:/var/lib/mysql
command: --default-authentication-plugin=mysql_native_password
api:
container_name: "gallery-api"
# we want to use the image which is build from our Dockerfile
build:
context: .
dockerfile: api.Dockerfile
ports:
- "8080:8080"
expose:
- "8080"
environment:
DB_USER: root
DB_PASS: 123456
DB_HOST: host.docker.internal
DB_PORT: 3306
DB_NAME: user
JWT_SECRET: ashpex
# we are depending on the mysql backend
depends_on:
- db
networks:
- default
# We mount the working dir into the container, handy for development
# This is what makes the hot reloading work inside a Docker container
volumes:
- .:/app/
nginx:
container_name: "nginx"
image: nginx
build:
context: .
dockerfile: nginx.Dockerfile
#volumes:
# - .:/etc/nginx/conf.d/
ports:
- "80:80"
depends_on:
- api
restart: always
networks:
- default
command: ["/usr/sbin/nginx", "-g", "daemon off;"]
prometheus:
container_name: Prometheus
image: prom/prometheus:latest
ports:
- 9090:9090
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --web.console.libraries=/etc/prometheus/console_libraries
- --web.console.templates=/etc/prometheus/consoles
- --storage.tsdb.retention.time=200h
- --web.enable-lifecycle
volumes:
- ./monitor/prometheus:/etc/prometheus
#- prometheus:/prometheus
- ./monitor/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
depends_on:
- api
- db
grafana:
container_name: Grafana
image: grafana/grafana
ports:
- 4000:3000
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- ./data:/var/lib/grafana
- ./monitor/grafana/provisioning:/etc/grafana/provisioning
restart: always
depends_on:
- prometheus
networks:
default:
volumes:
mysql_data: