-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.local.yaml
More file actions
76 lines (71 loc) · 2.06 KB
/
docker-compose.local.yaml
File metadata and controls
76 lines (71 loc) · 2.06 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
version: "3.8"
# For local development, only database is running
#
# docker-compose up -d
# uvicorn app.main:app --reload
#
services:
db-local:
restart: always
image: postgres:15.3
volumes:
- ${POSTGRES_HOME_DIR}/data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${DEFAULT_DATABASE_DB}
- POSTGRES_USER=${DEFAULT_DATABASE_USER}
- POSTGRES_PASSWORD=${DEFAULT_DATABASE_PASSWORD}
env_file:
- .env
ports:
- "${DEFAULT_DATABASE_PORT}:5432"
networks:
- backend
# 서비스명
# Redis Cluster 설정
redis-cluster-creator-local:
# 사용할 이미지
image: redis:latest
# 컨테이너명 설정
container_name: redis-cluster-creator-local
# 접근 포트 설정 (컨테이너 외부:컨테이너 내부)
depends_on:
- redis-cluster-local
- redis-node2-local
- redis-node3-local
# 명령어 설정
command: redis-cli --cluster create 127.0.0.1:6379 127.0.0.1:6380 127.0.0.1:6381 --cluster-yes
network_mode: "service:redis-cluster-local"
# 네트워크 설정
# Redis Node1 설정
redis-cluster-local:
image: redis:latest
container_name: redis-cluster-local
restart: always
volumes:
- ./redis-node.conf:/usr/local/etc/redis.conf
command: ["redis-server", "/usr/local/etc/redis.conf", "--port", "6379"]
ports:
- 6379:6379
- 6380:6380
- 6381:6381
# Redis Node1 설정
redis-node2-local:
image: redis:latest
container_name: redis-node2-local
restart: always
volumes:
- ./redis-node.conf:/usr/local/etc/redis.conf
command: ["redis-server", "/usr/local/etc/redis.conf", "--port", "6380"]
network_mode: "service:redis-cluster-local"
# Redis Node1 설정
redis-node3-local:
image: redis:latest
container_name: redis-node3-local
restart: always
volumes:
- ./redis-node.conf:/usr/local/etc/redis.conf
command: ["redis-server", "/usr/local/etc/redis.conf", "--port", "6381"]
network_mode: "service:redis-cluster-local"
networks:
backend:
driver: "bridge"