-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompose.yaml
201 lines (199 loc) · 5.89 KB
/
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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
services:
nginx:
image: nginx:1.27.2 # alpine 버전은 addUser 적용안되는 문제가 있음
profiles: ["prod"]
restart: always
volumes:
- /etc/letsencrypt:/etc/letsencrypt # SSL 인증서 경로
- /var/lib/letsencrypt:/var/lib/letsencrypt # Certbot 인증서 갱신 관련 파일
- /var/www/upup-radio.site:/var/www/upup-radio.site # front app 파일
# - /etc/nginx/conf.d:/etc/nginx/conf.d # migration (Nginx 설정 디렉토리)
# - /etc/nginx/sites-available:/etc/nginx/sites-available # migration
# - /etc/nginx/sites-enabled:/etc/nginx/sites-enabled # migration
- ./nginx/nginx.conf:/etc/nginx/nginx.conf # Nginx 설정 파일 마운트
- ./nginx/deploy.conf:/etc/nginx/conf.d/deploy.conf # 블루-그린 배포 설정
- ./nginx/upup-radio.site:/etc/nginx/sites-available/upup-radio.site # 도메인 관련 설정
container_name: nginx
# command issue: ln -sf 를 해도 덮어쓰기가 안되고 에러가 발생 => 해결 필요
command: >
sh -c "mkdir -p /etc/nginx/sites-enabled/ && ln -sf /etc/nginx/sites-available/dev.upup-radio.site /etc/nginx/sites-enabled/"
ports:
- '80:80'
- '443:443'
networks:
- bside-network
mysql:
image: 'mysql:8.0.39'
profiles: ["dev", "prod"]
volumes:
- data:/var/lib/mysql
container_name: bside-rdb
env_file:
- .env
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_PASSWORD: ${DB_PASSWD}
MYSQL_ROOT_PASSWORD: ${DB_PASSWD}
MYSQL_USER: ${DB_USERNAME}
ports:
- '3307:3306'
networks:
- bside-network
redis:
profiles: ["dev", "prod"]
image: 'redis:7.4-alpine'
restart: always
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
retries: 10
container_name: bside-redis
ports:
- '6380:6379'
networks:
- bside-network
backend:
profiles: ["dev"]
build:
context: .
dockerfile: Dockerfile-dev
restart: always
container_name: backend
command: >
sh -c "mkdir -p logs"
volumes:
- ./logs:/app/logs
- ./pinpoint-agent:/pinpoint-agent
entrypoint:
- sh
- -c
- |
java \
-javaagent:/pinpoint-agent/pinpoint-bootstrap-3.0.1.jar \
-Dpinpoint.agentId=${PINPOINT_AGENT_ID:-NoAgentId} \
-Dpinpoint.applicationName=${PINPOINT_APPLICATION_NAME:-NoApplicationName} \
-Dspring.profiles.active=${SPRING_ACTIVE_PROFILE} \
-Duser.timezone=Asia/Seoul \
-jar ${JAR_FILENAME}.jar
env_file:
- .env
environment:
PINPOINT_AGENT_ID: ${PINPOINT_AGENT_ID}
ports:
- '8082:8080'
- '9292:9292'
depends_on:
mysql:
condition: service_started
redis:
condition: service_healthy
networks:
- bside-network
prometheus:
image: prom/prometheus-linux-arm64
profiles: ["prod"]
restart: always
container_name: prometheus
volumes:
- prometheus_data:/prometheus
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml' # 설정 파일 위치
- '--storage.tsdb.path=/prometheus' # 디스크 위치
- '--storage.tsdb.retention.time=15d' # 원하는 보관 기간 설정
ports:
- '9090:9090'
networks:
- bside-network
grafana:
profiles: ["prod"]
image: grafana/grafana
restart: always
container_name: grafana
volumes:
- grafana_data:/var/lib/grafana
ports:
- '3000:3000'
networks:
- bside-network
elasticsearch:
image: elasticsearch:8.15.3
profiles: ["prod"]
container_name: elasticsearch
command: >
sh -c "elasticsearch-plugin install analysis-nori && /usr/local/bin/docker-entrypoint.sh"
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
- ./elk/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
ports:
- '9200:9200'
- '9300:9300'
env_file:
- .env
environment:
discovery.type: single-node
ES_JAVA_OPTS: "-Xms2g -Xmx2g"
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
networks:
- bside-network
logstash:
image: logstash:8.15.3
profiles: ["prod"]
container_name: logstash
volumes:
- ./elk/logstash.yml:/usr/share/logstash/config/logstash.yml:ro
- ./elk/logstash.conf:/usr/share/logstash/pipeline/logstash.conf:ro
ports:
- "5044:5044"
env_file:
- .env
environment:
LOGSTASH_INTERNAL_USERNAME: ${LOGSTASH_INTERNAL_USERNAME}
LOGSTASH_INTERNAL_PASSWORD: ${LOGSTASH_INTERNAL_PASSWORD}
networks:
- bside-network
depends_on:
- elasticsearch
kibana:
image: kibana:8.15.3
profiles: ["prod"]
container_name: kibana
volumes:
- ./elk/kibana.yml:/usr/share/kibana/config/kibana.yml:ro
ports:
- '5601:5601'
env_file:
- .env
environment:
ELASTIC_USERNAME: ${ELASTIC_USERNAME}
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
networks:
- bside-network
depends_on:
- elasticsearch
filebeat:
image: docker.elastic.co/beats/filebeat:8.15.3
profiles: ["prod"]
container_name: filebeat
user: root
command: >
sh -c "mkdir -p /var/logs && chown -R root /usr/share/filebeat && filebeat -e -strict.perms=false"
env_file:
- .env
volumes:
- ./logs:/var/logs
- ./elk/filebeat.yml:/usr/share/filebeat/filebeat.yml
networks:
- bside-network
depends_on:
- logstash
networks:
bside-network:
name: bside-network
driver: bridge
volumes:
data:
prometheus_data:
grafana_data:
elasticsearch_data: