-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
41 lines (39 loc) · 1.33 KB
/
Copy pathdocker-compose.yml
File metadata and controls
41 lines (39 loc) · 1.33 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
services:
mysql:
image: mysql:8.4
container_name: piki-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-root}
MYSQL_DATABASE: ${DB_NAME:-piki}
MYSQL_USER: ${DB_USERNAME:-piki}
MYSQL_PASSWORD: ${DB_PASSWORD:-piki}
ports:
# loopback 바인딩 — 공유망·원격 Docker host 에서 무인증 외부 접근을 막는다. 로컬 앱은 localhost 로 접속.
- "127.0.0.1:3306:3306"
volumes:
- piki-mysql-data:/var/lib/mysql
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
healthcheck:
# mysqladmin ping 은 인증 없이도 reachable 여부를 돌려준다.
# 인자에 비밀번호를 박으면 컨테이너 내부 ps / docker inspect 출력에 그대로 노출된다.
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 3s
retries: 10
redis:
image: redis:7.4-alpine
container_name: piki-redis
restart: unless-stopped
ports:
# loopback 바인딩 — Redis 무인증 외부 접근(데이터 변조·삭제) 차단. 로컬 앱은 localhost 로 접속.
- "127.0.0.1:6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
volumes:
piki-mysql-data: