-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
151 lines (140 loc) · 3.89 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
version: "3.8"
services:
postgres_order:
image: postgres:16
container_name: postgres_order_container
environment:
POSTGRES_DB: order_db
POSTGRES_USER: order_user
POSTGRES_PASSWORD: order_user123
volumes:
- postgres_order_data:/var/lib/postgresql/data
postgres_product:
image: postgres:16
container_name: postgres_product_container
environment:
POSTGRES_DB: product_db
POSTGRES_USER: product_user
POSTGRES_PASSWORD: product_user123
volumes:
- postgres_product_data:/var/lib/postgresql/data
postgres_authentication:
image: postgres:16
container_name: postgres_authentication_container
environment:
POSTGRES_DB: authentication_db
POSTGRES_USER: authentication_user
POSTGRES_PASSWORD: authentication_user123
volumes:
- postgres_authentication_data:/var/lib/postgresql/data
rabbitmq:
restart: always
image: "rabbitmq:3-management"
container_name: "rabbitmq_container"
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: "guest"
RABBITMQ_DEFAULT_PASS: "guest"
volumes:
- rabbitmq_data:/var/lib/rabbitmq
depends_on:
- postgres_order
- postgres_authentication
- postgres_product
backend_authentication:
build:
context: ./backend/authentication
dockerfile: Dockerfile
image: backend:product-authentication
container_name: product-authentication
command: sh -c "chmod +x ./migrate.sh && chmod +x ./entrypoint.sh && sh ./migrate.sh && ./entrypoint.sh"
ports:
- 8000:8000
env_file:
- ./backend/authentication/.env
volumes:
- ./backend/authentication:/product-authentication
depends_on:
- postgres_authentication
- rabbitmq
backend_order:
build:
context: ./backend/order
dockerfile: Dockerfile
image: backend:product-order
container_name: product-order
command: sh -c "chmod +x ./migrate.sh && chmod +x ./entrypoint.sh && sh ./migrate.sh && ./entrypoint.sh"
ports:
- 8001:8000
env_file:
- ./backend/order/.env
volumes:
- ./backend/order:/product-order
depends_on:
- postgres_order
- rabbitmq
backend_product:
build:
context: ./backend/product
dockerfile: Dockerfile
image: backend:product-product
container_name: product-product
command: sh -c "chmod +x ./migrate.sh && chmod +x ./entrypoint.sh && sh ./migrate.sh && ./entrypoint.sh"
ports:
- 8002:8000
env_file:
- ./backend/product/.env
volumes:
- ./backend/product/:/product-item
depends_on:
- postgres_product
- rabbitmq
celery_order:
restart: always
build:
context: ./backend/order
env_file:
- ./backend/order/.env
volumes:
- ./backend/order:/product-order
container_name: celery_order
depends_on:
- rabbitmq
- backend_order
- postgres_order
command: celery -A order worker --loglevel=info
celery_authentication:
restart: always
build:
context: ./backend/authentication
env_file:
- ./backend/authentication/.env
volumes:
- ./backend/authentication:/product-authentication
container_name: celery_authentication # Change the container name
depends_on:
- rabbitmq
- backend_authentication
- postgres_authentication
command: celery -A authentication worker --loglevel=info # Change the Celery app name
frontend:
container_name: frontend-product
build:
context: ./frontend/product
dockerfile: Dockerfile
image: frontend:frontend-product
ports:
- "5173:5173"
volumes:
- .:/frontend-product
depends_on:
- backend_authentication
- backend_order
- backend_product
volumes:
postgres_authentication_data:
postgres_order_data:
postgres_product_data:
rabbitmq_data: