-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
80 lines (78 loc) · 2.35 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
version: "2.2"
services:
inflearn-redis:
container_name: inflearn-redis
build:
dockerfile: Dockerfile
context: ./redis
image: leeyoungjin/inflearn-redis
ports:
- "6379:6379"
# 테스트용 CPU, 메모리 제한
cpus: 0.5
mem_limit: 1g
inflearn-database:
container_name: inflearn-database
build:
dockerfile: Dockerfile
context: ./database
image: leeyoungjin/inflearn-database
environment:
- MYSQL_DATABASE=inflearn
- MYSQL_ROOT_PASSWORD=${SPRING_DATASOURCE_PASSWORD}
volumes:
- ./database/config:/etc/mysql/conf.d
- ./database/data:/docker-entrypoint-initdb.d
ports:
- "3306:3306"
cpus: 0.5
mem_limit: 1g
inflearn-app:
container_name: inflearn-app
build: . # 도커파일이 있는 위치
depends_on: # 컨테이너 실행순서 지정 DB와 레디스가 띄워져있는상태에서 app을 실행한다.
- inflearn-database
- inflearn-redis
image: leeyoungjin/inflearn-app
environment:
- SPRING_DATASOURCE_USERNAME=${SPRING_DATASOURCE_USERNAME}
- SPRING_DATASOURCE_PASSWORD=${SPRING_DATASOURCE_PASSWORD}
- SPRING_PROFILES_ACTIVE=${SPRING_PROFILES_ACTIVE}
- GOOGLE_EMAIL_ACCOUNT=${GOOGLE_EMAIL_ACCOUNT}
- GOOGLE_EMAIL_PASSWORD=${GOOGLE_EMAIL_PASSWORD}
- NAVER_EMAIL_ACCOUNT=${NAVER_EMAIL_ACCOUNT}
- NAVER_EMAIL_PASSWORD=${NAVER_EMAIL_PASSWORD}
ports:
- "80:8080"
restart: always # 레디스나 DB가 실행가능한 상태가 아닌경우있을수있는데 그경우에 재시작할수있도록 설정
cpus: 1
mem_limit: 2g
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: always
ports:
- "3000:3000"
volumes:
- grafana-data:/var/lib/grafana
- ./grafana/provisioning/:/etc/grafana/provisioning/
environment:
- GF_SERVER_ROOT_URL=http://localhost:3000
- GF_SECURITY_ADMIN_PASSWORD=admin
depends_on:
- prometheus
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: always
ports:
- "9090:9090"
volumes:
- ./prometheus/config:/etc/prometheus/
- prometheus-data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
volumes:
grafana-data:
prometheus-data: