-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
174 lines (164 loc) · 3.2 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
services:
app1:
build:
dockerfile: ./Dockerfile
ports:
- 3000:3000
container_name: 1-nuxt-commerce
hostname: app1
# expose:
# - 3000
stdin_open: true
shm_size: 128mb
env_file:
- ./.env
volumes:
- .:/usr/app
- node_modules:/usr/app/node_modules:delegated
restart: on-failure
networks:
- comx-net
depends_on:
- postgres
- redis
- rabbitmq
- kafka
app2:
build:
dockerfile: ./Dockerfile
ports:
- 3001:3000
container_name: 2-nuxt-commerce
hostname: app2
# expose:
# - 3001
stdin_open: true
shm_size: 128mb
env_file:
- ./.env
volumes:
- .:/usr/app
- node_modules:/usr/app/node_modules:delegated
restart: on-failure
networks:
- comx-net
depends_on:
- postgres
- redis
- rabbitmq
- kafka
app3:
build:
dockerfile: ./Dockerfile
ports:
- 3002:3000
container_name: 3-nuxt-commerce
hostname: app3
# expose:
# - 3002
stdin_open: true
shm_size: 128mb
env_file:
- ./.env
volumes:
- .:/usr/app
- node_modules:/usr/app/node_modules:delegated
restart: on-failure
networks:
- comx-net
depends_on:
- postgres
- redis
- rabbitmq
- kafka
rabbitmq:
image: rabbitmq:3.13.3-management
restart: unless-stopped
container_name: nuxt-commerce-rabbitmq
shm_size: 100mb
env_file:
- .env
expose:
- 5672
ports:
- 15672:15672
volumes:
- nuxt-commerce-rabbitmq:/var/lib/rabbitmq
networks:
- comx-net
kafka:
image: apache/kafka:3.7.0
restart: unless-stopped
container_name: nuxt-commerce-kafka
shm_size: 100mb
env_file:
- .env
expose:
- 9092
# ports:
# - 29092:29092
postgres:
image: postgres:16-alpine
restart: unless-stopped
container_name: nuxt-commerce-postgres
shm_size: 256mb
env_file:
- ./.env
networks:
- comx-net
expose:
- 5432
volumes:
- nuxt-commerce-postgres:/var/lib/postgresql/data
# ports:
# - 5432:5432
redis:
image: redis:7.0-alpine
restart: unless-stopped
container_name: nuxt-commerce-redis
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD}
shm_size: 256mb
env_file:
- ./.env
ports:
- 6379:6379
volumes:
- ./redis:/usr/local/etc/redis
- nuxt-commerce-redis:/data
networks:
- comx-net
# nginx:
# image: nginx:1.27-alpine-perl
# restart: unless-stopped
# ports:
# - "80:80"
# depends_on:
# - app
# networks:
# - comx-net
caddy:
image: caddy:2.8.4-alpine
restart: unless-stopped
shm_size: 128mb
ports:
- "80:80"
depends_on:
- app1
- app2
- app3
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
volumes:
caddy_data:
caddy_config:
node_modules:
nuxt-commerce-postgres:
nuxt-commerce-redis:
nuxt-commerce-rabbitmq:
networks:
comx-net:
name: comx-net
driver: bridge
external: true