-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
130 lines (122 loc) · 3.11 KB
/
docker-compose.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
version: '3'
services:
client-service:
container_name: "client"
build:
context: ./client/.
dockerfile: Dockerfile
args:
VITE_API_URL: ${VITE_API_URL}
# ports:
# - ${CLIENT_APP_EXTERNAL_PORT}:${CLIENT_APP_INTERNAL_PORT}
networks:
- mynetwork
depends_on:
- api-service-1
- api-service-2
api-service-1:
container_name: "api-1"
build:
context: ./api/.
dockerfile: Dockerfile
environment:
- SERVICE_NAME=api-service-1
- PORT=${API_SERVER_INTERNAL_PORT}
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
- REDIS_CHANNEL=${REDIS_CHANNEL}
- MYSQL_HOST=${MYSQL_HOST}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USERNAME=${MYSQL_USERNAME}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_TABLE=${MYSQL_TABLE}
# ports:
# - ${API_SERVER_EXTERNAL_PORT}:${API_SERVER_INTERNAL_PORT}
networks:
- mynetwork
depends_on:
- db
- redis
- worker-service
api-service-2:
container_name: "api-2"
build:
context: ./api/.
dockerfile: Dockerfile
environment:
- SERVICE_NAME=api-service-2
- PORT=${API_SERVER_INTERNAL_PORT}
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
- REDIS_CHANNEL=${REDIS_CHANNEL}
- MYSQL_HOST=${MYSQL_HOST}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USERNAME=${MYSQL_USERNAME}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_TABLE=${MYSQL_TABLE}
# ports:
# - ${API_SERVER_EXTERNAL_PORT}:${API_SERVER_INTERNAL_PORT}
networks:
- mynetwork
depends_on:
- db
- redis
- worker-service
worker-service:
container_name: "worker"
build: ./worker/.
environment:
- PORT=5002
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
- REDIS_CHANNEL=${REDIS_CHANNEL}
- MYSQL_HOST=${MYSQL_HOST}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USERNAME=${MYSQL_USERNAME}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_TABLE=${MYSQL_TABLE}
networks:
- mynetwork
depends_on:
- db
- redis
db:
container_name: "db"
build: ./db/.
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
# ports:
# - '3306:3306'
networks:
- mynetwork
redis:
container_name: "redis"
image: "redis:latest"
restart: always
command: redis-server --save 20 1 --loglevel warning --requirepass mypassword
# ports:
# - '6379:6379'
networks:
- mynetwork
nginx:
container_name: nginx_server
build:
context: ./nginx/.
dockerfile: Dockerfile
ports:
- ${NGINX_EXTERNAL_PORT}:${NGINX_INTERNAL_PORT}
environment:
- CLIENT_APP_INTERNAL_PORT=${CLIENT_APP_INTERNAL_PORT}
- API_SERVER_INTERNAL_PORT=${API_SERVER_INTERNAL_PORT}
networks:
- mynetwork
depends_on:
- client-service
- api-service-1
- api-service-2
networks:
mynetwork:
driver: bridge