-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
105 lines (96 loc) · 2.4 KB
/
docker-compose.yml
File metadata and controls
105 lines (96 loc) · 2.4 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
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
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
extra_hosts:
- host.docker.internal:host-gateway
env_file:
- .dev.env
# MySQL이 살아 있고 Redis가 시작된 뒤에만 기동
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_started
networks:
- socket-network
- ssafitv-network
mysql:
image: mysql:8.2.0
restart: always
volumes:
- ./mysql-data:/var/lib/mysql
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${SFTV_MYSQL_DATABASE}
MYSQL_USER: ${SFTV_MYSQL_USER}
MYSQL_PASSWORD: ${SFTV_MYSQL_PASSWORD}
MYSQL_ROOT_HOST: "%"
DEFAULT_AUTHENTICATION_PLUGIN: caching_sha2_password
# ── healthcheck: 서비스가 ready 상태인지 확인 ──
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-p${MYSQL_ROOT_PASSWORD}", "--silent"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
networks:
- socket-network
- ssafitv-network
redis:
env_file:
- .dev.env
image: redis:7-alpine
restart: always
command: sh -c "redis-server --requirepass ${REDIS_PASSWORD}"
ports:
- "6379:6379"
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD}
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
REDIS_URL: ${REDIS_URL}
networks:
- socket-network
- ssafitv-network
prometheus:
image: prom/prometheus:latest
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
ports:
- "9090:9090"
environment:
APP_SERVER: ${APP_SERVER}
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--web.listen-address=:9090'
networks:
- socket-network
- ssafitv-network
grafana:
image: grafana/grafana:latest
ports:
- "3001:3000"
environment:
GF_SECURITY_ADMIN_USER: ${GF_SECURITY_ADMIN_USER}
GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD}
GF_USERS_ALLOW_SIGN_UP: "false"
volumes:
- grafana-data:/var/lib/grafana
networks:
- socket-network
- ssafitv-network
volumes:
mysql-data:
grafana-data:
networks:
socket-network:
driver: bridge
ssafitv-network:
external: true