-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
147 lines (136 loc) · 3.56 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
version: '3'
services:
neo4j:
container_name: neo4j
image: neo4j:latest
restart: always
environment:
NEO4J_AUTH: ${NEO4J_AUTH}
ports:
- "7474:7474"
- "7687:7687"
volumes:
- ./nextpage-db/neo4j/data:/data
- ./nextpage-db/neo4j/logs:/logs
networks:
- npage
postgresql:
container_name: postgresql
image: postgres:12.0-alpine
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USERNAME}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- ./nextpage-db/postgres-data:/var/lib/postgresql/data
ports:
- 5432:5432
networks:
- npage
pgadmin:
# 사용할 이미지
image: dpage/pgadmin4
# 컨테이너 실행 시 재시작
restart: always
# 컨테이너명 설정
container_name: pgadmin4
user: root
# 접근 포트 설정 (컨테이너 외부:컨테이너 내부)
ports:
- "5050:80"
# 환경 변수 설정
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
# 볼륨 설정
volumes:
- ./nextpage-db/pgadmin/:/var/lib/pgadmin
networks:
- npage
# 스프링 로컬로 실행 시 주석 처리하고 DB만 도커 빌드
springboot:
build:
context: .
dockerfile: Dockerfile
restart: always
depends_on:
- neo4j
- postgresql
ports:
- 8080:8080
container_name: springboot
environment:
SPRING_DATASOURCE_URL: ${SPRING_DATASOURCE_URL}
SPRING_DATASOURCE_USERNAME: ${SPRING_DATASOURCE_USERNAME}
SPRING_DATASOURCE_PASSWORD: ${SPRING_DATASOURCE_PASSWORD}
SPRING_PROFILES_ACTIVE: ${SPRING_PROFILES_ACTIVE}
NEO4J_URI: ${SPRING_NEO4J_URI}
NEO4J_PASSWORD: ${SPRING_NEO4J_PASSWORD}
networks:
- npage
# Monitoring
grafana:
image: grafana/grafana:latest
container_name: grafana
user: root
ports:
- "3001:3000"
# env_file:
# - './monitoring/grafana/env.grafana'
volumes:
- './monitoring/grafana:/var/lib/grafana'
restart: always
environment:
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_BASIC_ENABLED=false
depends_on:
- springboot
networks:
- npage
k6:
image: grafana/k6:latest
container_name: k6
ports:
- "6565:6565"
environment:
- K6_OUT=influxdb=http://influxdb:8086/k6
volumes:
- ./monitoring/k6:/scripts
extra_hosts:
- "host.docker.internal:host-gateway" # 호스트와 연결(로컬테스트를 위함)
command: ["run", "/scripts/test_script.js"]
networks:
- npage
influxdb:
image: influxdb:1.8
ports:
- "8086:8086"
environment:
- INFLUXDB_DB=k6
restart: on-failure # 실패 시 재시작
networks:
- npage
prometheus:
image: prom/prometheus
container_name: prometheus
volumes:
- ./monitoring/prometheus/config:/etc/prometheus
- ./monitoring/prometheus/volume:/prometheus
ports:
- 9090:9090
command:
- '--web.enable-lifecycle' # api 재시작없이 설정 파일 reload
- '--storage.tsdb.path=/prometheus'
- '--config.file=/etc/prometheus/prometheus.yml'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
user: root
restart: always
networks:
- npage
networks:
npage:
driver: bridge