-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.prod.yml
154 lines (140 loc) · 3.67 KB
/
docker-compose.prod.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
146
147
148
149
150
151
152
153
154
services:
db-healthcheck:
image: curlimages/curl:latest
container_name: db-healthcheck
command: >
/bin/sh -c "
curl -f telnet://${REDIS_HOST}:${REDIS_PORT} || exit 1;
curl -f telnet://${MYSQL_HOST}:${MYSQL_PORT} || exit 1;
curl -f telnet://${MONGO_HOST}:27017 || exit 1;
"
healthcheck:
test: ["CMD", "/bin/sh", "-c", "exit 0"]
interval: 10s
timeout: 5s
retries: 3
load-balancer:
container_name: lb-container
ports:
- "4242:4242"
build:
target: production
environment:
# 배포 환경 세팅
- NODE_ENV=production
# Mongo 세팅
- LOG_LEVEL=${LOG_LEVEL}
# Redis 세팅
- REDIS_USERNAME=${REDIS_USERNAME}
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
networks:
- app-network
collaborative-room1:
container_name: collaborative-room1
ports:
- "9001:9001"
build:
target: production
environment:
# 배포 환경 세팅
- NODE_ENV=production
# MySQL 세팅
- MYSQL_HOST=${MYSQL_HOST}
- MYSQL_PORT=${MYSQL_PORT}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
# Mongo 세팅
- MONGO_HOST=${MONGO_HOST}
- MONGO_USER=${MONGO_USER}
- MONGO_PASSWORD=${MONGO_PASSWORD}
- MONGO_DB=${MONGO_DB}
- LOG_LEVEL=${LOG_LEVEL}
# Redis 세팅
- REDIS_USERNAME=${REDIS_USERNAME}
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
# WebSocket 서버 세팅
- SERVER_ID=${WS1_SERVER}
- WS_PORT=${WS1_PORT}
networks:
- app-network
collaborative-room2:
container_name: collaborative-room2
ports:
- "9002:9002"
build:
target: production
environment:
# 배포 환경 세팅
- NODE_ENV=production
# MySQL 세팅
- MYSQL_HOST=${MYSQL_HOST}
- MYSQL_PORT=${MYSQL_PORT}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
# Mongo 세팅
- MONGO_HOST=${MONGO_HOST}
- MONGO_USER=${MONGO_USER}
- MONGO_PASSWORD=${MONGO_PASSWORD}
- MONGO_DB=${MONGO_DB}
- LOG_LEVEL=${LOG_LEVEL}
# Redis 세팅
- REDIS_USERNAME=${REDIS_USERNAME}
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
# WebSocket 세팅
- SERVER_ID=${WS2_SERVER}
- WS_PORT=${WS2_PORT}
networks:
- app-network
api:
container_name: api
ports:
- "3000:3000"
build:
target: production
environment:
# 배포 환경 세팅
- NODE_ENV=production
# MySQL 세팅
- MYSQL_HOST=${MYSQL_HOST}
- MYSQL_PORT=${MYSQL_PORT}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
# Mongo 세팅
- MONGO_HOST=${MONGO_HOST}
- MONGO_USER=${MONGO_USER}
- MONGO_PASSWORD=${MONGO_PASSWORD}
- MONGO_DB=${MONGO_DB}
- LOG_LEVEL=${LOG_LEVEL}
networks:
- app-network
frontend:
container_name: frontend
depends_on:
api:
condition: service_started
collaborative-room1:
condition: service_started
collaborative-room2:
condition: service_started
load-balancer:
condition: service_started
ports:
- "80:80"
environment:
- NODE_ENV=production
extra_hosts:
- "db-host:${DATABASE_HOST}"
networks:
- app-network
networks:
app-network:
driver: bridge